feat(bls-12-381): add test vectors for BLS-12-381#224
Open
tob-scott-a wants to merge 5 commits intoC2SP:mainfrom
Open
feat(bls-12-381): add test vectors for BLS-12-381#224tob-scott-a wants to merge 5 commits intoC2SP:mainfrom
tob-scott-a wants to merge 5 commits intoC2SP:mainfrom
Conversation
The methodology for generating this test vectors is as follows: 1. Source several high-quality implementations. 2. Run mutation testing on each of them. 3. Have Claude write additional test inputs intended to trigger more behaviors in internal functions not currently exercised by the incumbent test suites. 4. Re-run the mutation testing framework with the new Wycheproof harness and new JSON files. 5. Compare before/after. The end result are a set of static tests that ensure implementations do not have subtle mistakes that the barebones known answer tests do not detect.
Go's json.Marshal HTML-escapes > as \u003e; reformat_json.py expects literal >= characters. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cpu
approved these changes
Mar 20, 2026
Member
cpu
left a comment
There was a problem hiding this comment.
Thanks! I think this mutation based approach for generating vectors is really cool 🚀
I propose we consider the feedback I left, give it a bit to see if anyone else has input, and then merge. Sound good?
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.
The methodology for generating this test vectors is as follows:
The end result are a set of static tests that ensure implementations do not have subtle mistakes that the barebones known answer tests do not detect.
Here's an example of the delta in mutation testing coverage provided by the JSON files generated in this PR, against https://github.com/zkcrypto/bls12_381:
&→^), arithmetic (square, neg, from_bytes)*Full file now tested (more mutants in scope).