Skip to content

Conversation

@yelhousni
Copy link
Contributor

@yelhousni yelhousni commented Apr 26, 2023

In ECDSA verification (or ECRecover), we compute [r/s]pubKey + [h/s]g where (r,s) is the signature, h the hash of the message and g the canonical generator of the subgroup. Previously, we took into consideration the edge cases where either or both r and h can be 0 and also pubKey=(0,0), but the EYP rules out these:

  • s ≠ 0 and r ≠ 0

image

  • pubKey ≠ (0,0) (because private key ≠ 0)

image

The PR introduces the JointScalarMulBase method which performs [s1]p1 + [s2]g assuming that s1 and s2 are nonzero and p1 not the infinity (0,0). This saves ~17k constraints in ECDSA verifier gadget.

@yelhousni yelhousni added type: perf dep: linea Issues affecting Linea downstream labels Apr 26, 2023
@yelhousni yelhousni added this to the v0.9.0 milestone Apr 26, 2023
@yelhousni yelhousni requested a review from ivokub April 26, 2023 11:04
Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@yelhousni yelhousni merged commit e9ff34a into develop Apr 28, 2023
@yelhousni yelhousni deleted the perf/ecdsa branch April 28, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dep: linea Issues affecting Linea downstream type: perf

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants