-
Notifications
You must be signed in to change notification settings - Fork 351
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
Secp256r1 support #1983
Secp256r1 support #1983
Conversation
40eae37
to
77bcfdb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thank you. I did not do a full review yet but will follow up.
Some high level questions:
- Who needs this implementation for what? I was planning to add it to 2.1 to be prepared for passkey apps.
- Don't we need pubkey recovery here?
- I was thinking not requiring low-S signatures in secp256k1 by default was a mistake as all modern blockchain applications require low-S. Right now in CosmWasm you have to check low-S yourself in the contract if your protocol needs it. Maybe it's a good opportunity to make a better decision here. Any thoughts?
I just saw the pending / partial long standing PR and decided to jump in.
Will take a look. Seen some comments about lack of recovery for this, but that may be wrong.
I think there's a normalisation step related to that. Do you want to fail in case of high S? |
13abb59
to
442c163
Compare
For non-Ethereum and non-Bitcoin ECDSA, high S is perfectly valid. It's really up to the application to limit it. This is why we accept both in secp256k1_verify. The comments in https://twitter.com/simon_warta/status/1744814900164059555 are also not really convincing me to change it. Maybe it is better to just create a |
Added to the crypto package. Will work in the rest (imports / mappings) later. |
ed59b75
to
3d7970f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thanks a lot!
Befor the final merge, we should ensure this new API works for Passkeys. I am asking around how to best find test vectors for that.
d1d7a29
to
e49d834
Compare
Co-authored-by: Mauro Lacy <[email protected]>
Add test vectors from Project Wycheproof for secp256r1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this nice work!
Completes the work done in #1877, which is in turn a follow-up of #1083.
main
.secp256r1_recover_pubkey
.secp256r1_verify
endpoint / tests tocrypto-verify
.