-
Notifications
You must be signed in to change notification settings - Fork 156
Integrate Wycheproof ML-KEM test vectors #2891
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
base: main
Are you sure you want to change the base?
Conversation
### Issues: Integrating Wycheproof ML-KEM test vectors. ### Description of changes: Integrates all 6 Wycheproof ML-KEM test vector files: - 3 ML-KEM encapsulation test files (mlkem_512_encaps_test, mlkem_768_encaps_test, mlkem_1024_encaps_test) - 3 ML-KEM decapsulation test files (mlkem_512_test, mlkem_768_test, mlkem_1024_test) Each integration adds upstream JSON vectors and converted txt files to `third_party/vectors/`, and adds test code with duvet annotations for traceability. ### Call-outs: - We successfully import ML-KEM encapsulation keys with modulus overflow. This is allowed by FIPS 203, but is not ideal, so the tests print a warning. - Decapsulation tests have only one test case per parameter set. We will add more vectors in follow-up PR. ### Testing: All new tests pass and duvet verification succeeds: ```bash cd build && ./crypto/crypto_test --gtest_filter="*Wycheproof*" cd third_party/vectors && python3 sync.py ``` 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.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2891 +/- ##
==========================================
- Coverage 78.42% 78.27% -0.16%
==========================================
Files 683 683
Lines 117492 117685 +193
Branches 16514 16520 +6
==========================================
- Hits 92142 92113 -29
- Misses 24460 24684 +224
+ Partials 890 888 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I added some noseed decaps test vectors to see how we handle invalid decaps keys, and similarly to encaps, we successfully import invalid decaps keys, but do not successfully decaps with them. This also seems not-ideal. |
Description of changes:
Integrates 9 Wycheproof ML-KEM test vector files:
Each integration adds upstream JSON vectors and converted txt files to
third_party/vectors/, and adds test code with duvet annotations for traceability.Call-outs:
mlkem_*_decaps_test) are new, and I opened a PR to upstream Wycheproof: Add ML-KEM decapsulation validation test vectors C2SP/wycheproof#202Testing:
All new tests pass and duvet verification succeeds:
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.