crypto: add go-based BatchVerifier implementation#6440
Merged
cce merged 11 commits intoalgorand:masterfrom Sep 22, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6440 +/- ##
==========================================
- Coverage 50.84% 50.72% -0.12%
==========================================
Files 664 658 -6
Lines 111455 111478 +23
==========================================
- Hits 56665 56552 -113
- Misses 51924 52044 +120
- Partials 2866 2882 +16 ☔ View full report in Codecov by Sentry. |
cce
commented
Sep 15, 2025
zeldovich
previously approved these changes
Sep 16, 2025
jannotti
reviewed
Sep 17, 2025
Co-authored-by: John Jannotti <jannotti@gmail.com>
cce
commented
Sep 18, 2025
Contributor
Author
|
OK, updated with @jannotti's feedback and brought in more test vectors from crypto/ed25519/ed25519vectors_test.go plus new tests specifically for |
jannotti
previously approved these changes
Sep 18, 2025
jannotti
approved these changes
Sep 19, 2025
zeldovich
approved these changes
Sep 19, 2025
algorandskiy
approved these changes
Sep 22, 2025
algorandskiy
pushed a commit
to algorandskiy/go-algorand
that referenced
this pull request
Sep 25, 2025
This adds a pure-Go ed25519 BatchVerifier implementation based on the ed25519consensus library, with additional checks to preserve our ed25519 validation criteria, last updated in algorand#3031. Like our libsodium batch verification implementation, the IsCanonicalY check here is also based on the "Taming the Many EdDSAs" paper in https://eprint.iacr.org/2020/1244 New tests added to compare ed25519 criteria results match our existing libsodium- and ed25519-donna-based batch verification implementation (from algorand#3031 and defined in algorandfoundation/specs#60). New test helpers run test vectors with different batch sizes, taken from - 12 edge cases from "Taming the many EdDSAs" Appendix C, Table 6c, also used in our libsodium fork's tests in batch verification: add ed25519 batch verification implementation algorand#3031 - 1025 successful cases from our libsodium fork's tests, also added in batch verification: add ed25519 batch verification implementation algorand#3031. - 196 edge cases used to draw the 14x14 grid visualizations from the blog post "It's 255:19AM. Do you know what your validation criteria are?" and used in ed25519consensus - 768 edge cases from the Go crypto package's crypto/ed25519/ed25519vectors_test.go
Closed
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.
Summary
This adds a pure-Go ed25519 BatchVerifier implementation using on the ed25519consensus library, plus additional checks to preserve our ed25519 validation criteria, last updated in #3031 (reject small order A; reject non-canonical A, R, S; use the cofactor equation).
Like our libsodium batch verification implementation, the



IsCanonicalYcheck here is also based on the "Taming the Many EdDSAs" paper in https://eprint.iacr.org/2020/1244Test Plan
New tests added to compare ed25519 criteria results match our existing libsodium- and ed25519-donna-based batch verification implementation (from #3031 and defined in algorandfoundation/specs#60). New test helpers run test vectors with different batch sizes, taken from