Repository navigation
Another Round of Inlining Optimizations - Poseidon2 - #36
Merged
Merged
Conversation
Signature verification went down from 290 microseconds to 130~ (combining with #36). (ECgFp5Point's was using lot of divisions, and there weren't any other way to calculate it other than Fermat, which was taking lot of field operations.) After #36, it was 235 microseconds. - Main optimization is passing to AffinePoints for Verification (this brought it down to 175). - Precomputing the generator's affine windows also helped another 10-15 microseconds. - Delaying carries did the last 30 microseconds. There is probably a bit more room, maybe 10%~.
eminayar
approved these changes
Jul 7, 2026
eminayar
left a comment
Contributor
There was a problem hiding this comment.
LGTM, would be nice if someone else also takes a look though
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.
37.5% faster than before.
Ready for review
I checked out the arithmetic and it seems fine. Also run on a bunch of tests, but still I will run a multi-hour fuzz+random test.
Update:
Run 6 hours of random and fuzz tests, all passing.
Run on end to end tests, all passing.
Now this PR also includes signature verification speed up.