Conversation
Adds the ML-KEM files from C2SP/wycheproof testvectors_v1 at 3fa63dd.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review comments remain, and the supplied assessments support approval.
Review effort: Lite
Findings: None
What changed in this PR
Adds Wycheproof ML-KEM coverage for ML-KEM-512, ML-KEM-768, and ML-KEM-1024.
Changes:
- Adds a reusable test runner for key generation, encapsulation, decapsulation, and malformed inputs.
- Adds twelve compressed ML-KEM test-vector files.
| File | Summary |
|---|---|
kem/schemes/wycheproof_test.go |
Implements ML-KEM Wycheproof vector execution and rejection checks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or 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
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.
sign/schemesruns the Wycheproof ML-DSA vectors; this does the same for ML-KEM. It adds the twelvemlkem_{512,768,1024}_*files from C2SP/wycheprooftestvectors_v1at3fa63dd, gzipped underkem/schemes/testdata/wycheproof/like the ML-DSA ones, andkem/schemes/wycheproof_test.go:MLKEMTestek, decapsulatec(a wrong-lengthcmust be rejected), compareK; a wrong-length seed counts as rejected, sinceDeriveKeyPairpanics on itMLKEMEncapsTestek(unreduced and wrong-length keys must be rejected), encapsulate withm, comparecandKMLKEMDecapsValidationTestdk(wrong length or bad hash must be rejected), compare itsek, decapsulatec(wrong length must be rejected)MLKEMKeyGenekanddkAn invalid case passes only if the scheme returns an error. Wrong outputs are reported separately, so a mismatch never counts as the expected rejection.
All 1,725 cases pass on main, also under
GOOS=js GOARCH=wasm.golangci-lint(v2.12.2) and the shadow check are clean.