-
Notifications
You must be signed in to change notification settings - Fork 519
crypto: add go-based BatchVerifier implementation #6440
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
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. |
Co-authored-by: John Jannotti <[email protected]>
|
OK, updated with @jannotti's feedback and brought in more test vectors from crypto/ed25519/ed25519vectors_test.go plus new tests specifically for |
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
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