perf:avoid wasteful to_affine inversions in ecrecover#859
Merged
Conversation
Collaborator
Author
|
/bench-prove |
Benchmark — ethrex 20 transfers (median of 3)Table parallelism: auto (cores / 3)
Commit: 29de893 · Baseline: cached · Runner: self-hosted bench |
jotabulacios
marked this pull request as ready for review
July 23, 2026 20:18
diegokingston
approved these changes
Jul 24, 2026
ColoCarletti
approved these changes
Jul 24, 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.
The ECSM ecrecover path lifted already-affine points (G, decompressed R, and the result) to Z=1 projective and called k256's to_affine, which runs a full field inversion regardless of Z — paying a ~256-mul inversion to recover coordinates we already had, 3× per recovery.
lincomb2_with_oracle/ecsm_lincomb2 now take and return AffinePoint and ecrecover uses the affine result directly. Results are identical; guards and the on-curve check are unchanged.