-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add runtime options to break the pairwise consistency test for Ed, ML-KEM, and ML-DSA #2192
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2192 +/- ##
=======================================
Coverage 79.05% 79.05%
=======================================
Files 612 612
Lines 106159 106159
Branches 15002 15002
=======================================
+ Hits 83923 83927 +4
+ Misses 21582 21579 -3
+ Partials 654 653 -1 ☔ View full report in Codecov by Sentry. |
crypto/ml_dsa/ml_dsa_ref/sign.c
Outdated
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.
LGTM!
|
||
if [ ! -f $TEST_FIPS_BIN ]; then | ||
echo "$TEST_FIPS_BIN is missing. Run this script from the top level of a" | ||
echo "BoringSSL checkout and ensure that ./build-fips-break-test-binaries.sh" |
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.
echo "BoringSSL checkout and ensure that ./build-fips-break-test-binaries.sh" | |
echo "AWS-LC checkout and ensure that ./build-fips-break-test-binaries.sh" |
?
762bc9d
1be4999
to
762bc9d
Compare
@@ -36,6 +36,7 @@ | |||
|
|||
#include "../../crypto/fipsmodule/evp/internal.h" | |||
#include "../../crypto/fipsmodule/kem/internal.h" | |||
#include "../../crypto/fipsmodule/pqdsa/internal.h" |
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.
Broader question, what is the purpose of test_fips.c
. My recollection is that it is an abomination of a file with a very large main function, and I'm pretty sure doesn't include support for everything that is FIPS approved. Honestly it feels a bit duplicative to what should be in crypto_test
?
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.
For example I'm pretty sure this doesn't have ed25519ph tested :)
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.
You are correct, test_fips is a big file that turns into an executable with some of the algorithms. I think this file was used by BoringSSL to demonstrate certain things to their lab. We now use it in our CI to run/verify the break tests work as expected. In this case I needed to add algorithms to it to trigger the lazy self tests.
The break-tests could use crypto_test, but it's a little hard to write tests for the FIPS failure abort cases.
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.
This doesn't need ed25519ph because this change is only adding support to break the pairwise consistency tests and all the Ed stuff uses the same keygen function. However I did need to add the the pre-hash changes to test breaking the self test and that's already checked in https://github.com/aws/aws-lc/blob/main/util/fipstools/test_fips.c#L416-L430.
@andrewhop Could |
For the time being, |
Description of changes:
To easily demonstrate the pairwise consistency tests function this change adds support to the existing BORINGSSL_FIPS_BREAK_TEST environment variable.
Testing:
This adds a new test file for all the runtime tests and runs them from the run_fips_test.sh script on the break-able build.
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.