feat(optimism): Add secp256r1 precompile for Fjord#1436
Merged
rakita merged 12 commits intobluealloy:mainfrom May 26, 2024
Merged
feat(optimism): Add secp256r1 precompile for Fjord#1436rakita merged 12 commits intobluealloy:mainfrom
rakita merged 12 commits intobluealloy:mainfrom
Conversation
feb8f4c to
9c04e78
Compare
rakita
reviewed
May 25, 2024
rakita
reviewed
May 25, 2024
rakita
reviewed
May 25, 2024
rakita
reviewed
May 25, 2024
rakita
reviewed
May 25, 2024
53a54e2 to
f880ab8
Compare
rakita
reviewed
May 25, 2024
| // Can fail only if the input is not exact length. | ||
| let signature = Signature::from_slice(sig).unwrap(); | ||
| // Can fail if the input is not valid, so we have to propagate the error. | ||
| let public_key = VerifyingKey::from_sec1_bytes(&uncompressed_pk).ok()?; |
Member
There was a problem hiding this comment.
Have checked this part of the spec:
Note that many implementations use (0, 0) as the reference point at infinity, which is not on the curve and should therefore be rejected.
I have feed the VerifyingKey::from_sec1_bytes with pk = [0;64] and it fails to get key, this is expected behaviour, just wanting to note it.
Contributor
Author
There was a problem hiding this comment.
Thanks, added a test case for this
rakita
reviewed
May 25, 2024
rakita
reviewed
May 25, 2024
rakita
reviewed
May 25, 2024
This was referenced May 25, 2024
Closed
Closed
Closed
This was referenced May 31, 2024
Closed
Closed
Closed
Closed
This was referenced Jun 17, 2024
Closed
Closed
Merged
j75689
added a commit
to j75689/revm
that referenced
this pull request
Aug 1, 2024
* feat(optimism): Add secp256r1 precompile for Fjord (bluealloy#1436) * feat(optimism): Add secp256r1 precompile for Fjord * Fix docs * Fix nostd build * Load fjord precompiles via optimism handler register * Remove outdated fjord() precompile spec constructor * Document the secp256r1 feature * Address feedback * Handle invalid signatures * Update crates/precompile/src/secp256r1.rs * Update crates/precompile/src/secp256r1.rs * Blank return on failed signature verification * Add test case for invalid (zero) pubkey --------- Co-authored-by: rakita <rakita@users.noreply.github.com> * feat: add Haber spec to opBNB --------- Co-authored-by: Brian Bland <brian.t.bland@gmail.com> Co-authored-by: rakita <rakita@users.noreply.github.com>
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.
secp256r1::P256VERIFYprecompile from the alphanet implementationP256Verifyto the chain precompiles post-fjord via the Optimism handle registerNote: Introduces new optional dependency on the
p256crate