Repository navigation
dh: run the current Wycheproof X25519 and X448 vectors - #705
Merged
Merged
Conversation
Adds testvectors_v1/x25519_test.json and x448_test.json at 3fa63dd.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review comments remain.
Review effort: Lite
Findings: None
What changed in this PR
Adds current C2SP Wycheproof v1 coverage for X25519 and X448 key agreement.
Changes:
- Adds tests for 518 X25519 and 510 X448 vectors.
- Adds compressed vector fixtures.
- Handles malformed X448 keys as rejected cases.
| File | Description |
|---|---|
dh/x448/key_test.go |
Adds Wycheproof v1 coverage for X448. |
dh/x25519/key_test.go |
Adds Wycheproof v1 coverage for X25519. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cjpatton
approved these changes
Nov 16, 2026
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.
dh/x25519runs an 87-case subset of Wycheproof v0.4.12, anddh/x448runs no Wycheproof vectors. This adds the current files from C2SP/wycheprooftestvectors_v1at3fa63dd(x25519_test.json, 518 cases, andx448_test.json, 510 cases), gzipped under each package'stestdata/, and aTestWycheproofV1in both packages. The existing X25519 test stays as it is: the current file was regenerated with different keys, so it does not contain the old cases.The check is the one the existing X25519 test uses: the shared secret must match, and
Sharedmust return true unless the case isacceptable. The 12 invalid X448 cases have 57-byte public keys, which aKeycannot hold, so they count as rejected by the type.All cases pass on main, also under
GOOS=js GOARCH=wasmand with-tags purego.golangci-lint(v2.12.2) and the shadow check are clean.