-
Notifications
You must be signed in to change notification settings - Fork 121
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
Move ML-DSA to fipsmodule #2175
Open
jakemas
wants to merge
22
commits into
aws:main
Choose a base branch
from
jakemas:mldsa-to-fipsmodule
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+39
−39
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2175 +/- ##
==========================================
- Coverage 79.03% 79.02% -0.02%
==========================================
Files 612 612
Lines 106065 106064 -1
Branches 14995 14993 -2
==========================================
- Hits 83832 83813 -19
- Misses 21580 21598 +18
Partials 653 653 ☔ View full report in Codecov by Sentry. |
andrewhop
pushed a commit
that referenced
this pull request
Feb 11, 2025
…errors (#2177) ### Issues: Resolves CI failures around delocator in #2175 ### Description of changes: The FIPS static builds for ARM are failing CI: ``` [57%] Building ASM object crypto/fipsmodule/CMakeFiles/bcm_hashunset.dir/bcm-delocated.S.o bcm.c: Assembler messages: bcm.c:125130: Error: shift expression expected at operand 2 -- movi v4.4s,0xf,.Lbcm_redirector_msl,8' bcm.c:125133: Error: shift expression expected at operand 2 -- mvni v3.4s,0x1f,.Lbcm_redirector_msl,8' bcm.c:130233: Error: shift expression expected at operand 2 -- movi v4.4s,0xf,.Lbcm_redirector_msl,8' bcm.c:130236: Error: shift expression expected at operand 2 -- mvni v3.4s,0x1f,.Lbcm_redirector_msl,8' bcm.c:190061: Error: shift expression expected at operand 2 -- movi v4.4s,0xf,.Lbcm_redirector_msl,8' bcm.c:190064: Error: shift expression expected at operand 2 -- mvni v3.4s,0x1f,.Lbcm_redirector_msl,8' bcm.c:206492: Error: shift expression expected at operand 2 -- movi v4.4s,0xf,.Lbcm_redirector_msl,8' bcm.c:206495: Error: shift expression expected at operand 2 -- mvni v3.4s,0x1f,.Lbcm_redirector_msl,8' ``` This was discussed back in #2096 but not merged due to the PR being closed. The Arm instruction has a special argument `msl` (https://developer.arm.com/documentation/100069/0606/SIMD-Vector-Instructions/MOVI--vector-). The delocator is intepreting `msl` as a function (or global symbol). Since it’s not defined in the fipsmodule, it creates a jump function `bcm_redirector_msl` outside the fipsmodule that removes a potential relocation. The suffix of `bcm_redirector_msl` is the original token, which matches `msl`. We fix by adding `msl` to the list of `ARMConstantTweak` and regenerate the `delocate.peg.go` file. After testing this fix, I begin to see a second error in `amazonlinux2023_clang15x_aarch_fips`: ``` [339/575] Generating bcm-delocated.S FAILED: crypto/fipsmodule/bcm-delocated.S /codebuild/output/src1965601223/src/github.com/aws/aws-lc/test_build_dir/crypto/fipsmodule/bcm-delocated.S panic: Symbol reference outside of ldr instruction [recovered] panic: error while processing "\tldrsw\tx9, [x9, :lo12:ml_dsa_zetas+4]\n" on line 120399: "Symbol reference outside of ldr instruction" ``` It seems that `ldrsw` is not recognised as `ldr`. We already have `ldrsw` in our code, so we extend the delocate.go to accept `ldrsw` in addition to `ldr`. ### Call-outs: Unblocks progress on work in the FIPS module, such as ED25519 and ML-DSA. 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: Merge after #2177 is merged.
Issues:
Resolves #CryptoAlg-2826
As part of validating ML-DSA into AWS-LC-FIPS we must include both
PQDSA
andML-DSA
directories into the fipsmodule.This PR is a repeat of:
Description of changes:
Much like the series of PRs for ML-KEM we will implement the move into the FIPS module across split PRs:
Previous PR:
This PR is part (2) to move
ML-DSA
fromcrypto/ml_dsa/
tocrypto/fipsmodule/ml_dsa/
.We did this once before:
But had to revert it here due to static fips builds for ARM failing in CI (CryptoAlg-2899)
We are now unblocked by:
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.