-
Couldn't load subscription status.
- Fork 148
Add msl to ARMConstantTweak and recognise ldrsw to prevent delocator errors #2177
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2177 +/- ##
=======================================
Coverage 79.01% 79.02%
=======================================
Files 612 612
Lines 106071 106072 +1
Branches 14994 14994
=======================================
+ Hits 83814 83821 +7
+ Misses 21604 21598 -6
Partials 653 653 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the arm delocator tests to include msl and ldrsw.
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` and `ML-DSA` directories into the fipsmodule. This PR is a repeat of: - #2095 ### Description of changes: Much like the series of PRs for ML-KEM we will implement the move into the FIPS module across split PRs: - #1828 - #1832 - #1838 Previous PR: - #2166 This PR is part (2) to move `ML-DSA` from `crypto/ml_dsa/` to `crypto/fipsmodule/ml_dsa/`. We did this once before: - #2095 But had to revert it here due to static fips builds for ARM failing in CI (CryptoAlg-2899) - #2104 We are now unblocked by: - #2177 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.
…2185) ### Description of changes: Looking at #2177 I noticed there were some obvious omissions for the ARM constant tweak. This change adds the left version of the right instructions we already have in case a compiler ever decides to use it in the future. ### Testing: Added new test code for the instructions, also updated delocate_test.go to print the first difference after printing the total file: ``` --- FAIL: TestDelocate (0.01s) --- FAIL: TestDelocate/aarch64-Basic (0.00s) delocate_test.go:94: delocated output differed. Wanted: .text .file 1 "inserted_by_delocate.c" .... Got: .text .file 1 "inserted_by_delocate.c" ..... delocate_test.go:100: First difference at line 187: Expected: " add x22, sp, #(13*32)+96*32" Got: "\tadd x22, sp, #(13*32)+96*32" ``` 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.
Issues:
Resolves CI failures around delocator in #2175
Description of changes:
The FIPS static builds for ARM are failing CI:
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 intepretingmslas a function (or global symbol). Since it’s not defined in the fipsmodule, it creates a jump functionbcm_redirector_msloutside the fipsmodule that removes a potential relocation. The suffix ofbcm_redirector_mslis the original token, which matchesmsl.We fix by adding
mslto the list ofARMConstantTweakand regenerate thedelocate.peg.gofile.After testing this fix, I begin to see a second error in
amazonlinux2023_clang15x_aarch_fips:It seems that
ldrswis not recognised asldr. We already haveldrswin our code, so we extend the delocate.go to acceptldrswin addition toldr.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.