Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ed25519ph and Ed25519ctx Support #2120

Merged
merged 5 commits into from
Jan 28, 2025
Merged

Ed25519ph and Ed25519ctx Support #2120

merged 5 commits into from
Jan 28, 2025

Conversation

skmcgrail
Copy link
Member

@skmcgrail skmcgrail commented Jan 15, 2025

Description of changes:

  • Add support for Ed25519ph and Ed25519ph where the digest is pre-computed and provided externally.
  • Add support for Ed25519ctx from RFC 8032.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@skmcgrail skmcgrail requested a review from a team as a code owner January 15, 2025 01:41
@skmcgrail skmcgrail requested a review from nebeid January 15, 2025 01:42
@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 87.62887% with 24 lines in your changes missing coverage. Please review.

Project coverage is 78.95%. Comparing base (81f138a) to head (a67ccaf).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crypto/curve25519_extra/curve25519_extra.c 75.00% 16 Missing ⚠️
crypto/fipsmodule/self_check/self_check.c 83.33% 4 Missing ⚠️
crypto/fipsmodule/curve25519/curve25519.c 95.23% 3 Missing ⚠️
crypto/fipsmodule/curve25519/ed25519_test.cc 96.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2120    +/-   ##
========================================
  Coverage   78.95%   78.95%            
========================================
  Files         610      611     +1     
  Lines      105293   105470   +177     
  Branches    14919    14939    +20     
========================================
+ Hits        83136    83276   +140     
- Misses      21505    21542    +37     
  Partials      652      652            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@andrewhop andrewhop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General notes:

  1. Missing service indicator tests for approved ph and unapproved ctx
  2. Missing ACVP demo vectors
  3. Double checking: can these new singing modes rely on the existing boringssl_ensure_eddsa_self_test or do we need a new ctx/ph specific self test?

include/openssl/curve25519.h Outdated Show resolved Hide resolved
crypto/fipsmodule/curve25519/ed25519ctx_tests.txt Outdated Show resolved Hide resolved
crypto/fipsmodule/curve25519/ed25519_test.cc Outdated Show resolved Hide resolved
include/openssl/curve25519.h Outdated Show resolved Hide resolved
include/openssl/curve25519.h Outdated Show resolved Hide resolved
crypto/fipsmodule/curve25519/curve25519.c Outdated Show resolved Hide resolved
crypto/fipsmodule/curve25519/curve25519.c Outdated Show resolved Hide resolved
@skmcgrail
Copy link
Member Author

Addressed all outstanding comments and remaining work items.

@skmcgrail skmcgrail force-pushed the ed25519ph-ll branch 3 times, most recently from dbd0146 to b5a7f2e Compare January 17, 2025 18:30
@torben-hansen torben-hansen self-requested a review January 21, 2025 18:12
include/openssl/curve25519.h Outdated Show resolved Hide resolved
include/openssl/curve25519.h Outdated Show resolved Hide resolved
include/openssl/curve25519.h Outdated Show resolved Hide resolved
crypto/fipsmodule/curve25519/internal.h Show resolved Hide resolved
crypto/fipsmodule/curve25519/curve25519.c Outdated Show resolved Hide resolved
crypto/fipsmodule/curve25519/curve25519.c Outdated Show resolved Hide resolved
torben-hansen
torben-hansen previously approved these changes Jan 25, 2025
Copy link
Contributor

@torben-hansen torben-hansen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But dreaded delocate issue shows in the CI logs....

[340/577] Generating delocate
[341/577] Generating bcm-delocated.S
[342/577] Building ASM object crypto/fipsmodule/CMakeFiles/bcm_hashunset.dir/bcm-delocated.S.o
FAILED: crypto/fipsmodule/CMakeFiles/bcm_hashunset.dir/bcm-delocated.S.o 
/usr/bin/gcc-11 -DBORINGSSL_FIPS -DBORINGSSL_HAVE_LIBUNWIND -DBORINGSSL_IMPLEMENTATION -DFIPS_ENTROPY_SOURCE_PASSIVE -I/codebuild/output/src3653541563/src/github.com/aws/aws-lc/test_build_dir/symbol_prefix_include -I/codebuild/output/src3653541563/src/github.com/aws/aws-lc/include -Wno-newline-eof -Wa,--noexecstack -O3 -DNDEBUG -fPIC -MD -MT crypto/fipsmodule/CMakeFiles/bcm_hashunset.dir/bcm-delocated.S.o -MF crypto/fipsmodule/CMakeFiles/bcm_hashunset.dir/bcm-delocated.S.o.d -o crypto/fipsmodule/CMakeFiles/bcm_hashunset.dir/bcm-delocated.S.o -c /codebuild/output/src3653541563/src/github.com/aws/aws-lc/test_build_dir/crypto/fipsmodule/bcm-delocated.S
bcm.c: Assembler messages:
bcm.c:7811: Error: pc-relative address offset out of range
bcm.c:7813: Error: pc-relative address offset out of range
bcm.c:7815: Error: pc-relative address offset out of range
ninja: build stopped: subcommand failed.

include/openssl/curve25519.h Outdated Show resolved Hide resolved
util/fipstools/acvp/acvptool/acvp.go Outdated Show resolved Hide resolved
@@ -51,6 +52,7 @@ var (
expectedOutFlag = flag.String("expected-out", "", "Name of a file to write the expected results to")
wrapperPath = flag.String("wrapper", "../../../../build/util/fipstools/acvp/modulewrapper/modulewrapper", "Path to the wrapper binary")
waitForDebugger = flag.Bool("wait-for-debugger", false, "If true, jobs will run one at a time and pause for a debugger to attach")
katFilePath = flag.String("kat-out", "", "Writes a KAT file out if with test information for use with AWS-LC's file-based test framework. Support is limited, so if you don't see content its likely not plumbed in.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where was this argument used and the path to the file passed in? Maybe it can be added to the PR description if done offline.

Copy link
Member Author

@skmcgrail skmcgrail Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 560 is where it is used in code if set, there is nothing to plumb in, it's for an operator to invoke manually if they need to exercise this specific niche scenario. Similar to the wait-for-debuger argument. It's an aide nothing more.

crypto/fipsmodule/curve25519/internal.h Outdated Show resolved Hide resolved
@skmcgrail skmcgrail merged commit c7a37d7 into aws:main Jan 28, 2025
123 of 126 checks passed
@skmcgrail skmcgrail deleted the ed25519ph-ll branch January 28, 2025 18:54
manastasova pushed a commit to manastasova/aws-lc that referenced this pull request Jan 30, 2025
### Description of changes: 
* Add support for Ed25519ph and Ed25519ph where the digest is
pre-computed and provided externally.
* Add support for Ed25519ctx from RFC 8032.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants