Skip to content

EIP-7951: Precompile for secp256r1 Curve Support #31991

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Jun 9, 2025

Comment on lines 30 to 32
if x.Sign() == 0 && y.Sign() == 0 {
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this check needed? Which part of the EIP does this correspond to?

I believe this check was not added in the RIP version, neither was it present in the implementation deployed in Scroll or OP.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be the answer: ethereum-optimism/op-geth#168 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think we can get rid of it,

for more context, https://github.com/golang/go/blob/master/src/crypto/elliptic/nistec.go#L129-L134

@jwasinger jwasinger changed the title EIP-7951: Precompile for secp256r1 Curve Support EIP-7212: Precompile for secp256r1 Curve Support Jun 10, 2025
@alexb5dh
Copy link

Is this 7212 (which uses r' == r) or 7951 (r' == r [mod n])?

@jwasinger jwasinger changed the title EIP-7212: Precompile for secp256r1 Curve Support EIP-7951: Precompile for secp256r1 Curve Support Jun 10, 2025
@jwasinger
Copy link
Contributor

@alexb5dh I changed the title by mistake. Have corrected it now. This reflects EIP-7951

Comment on lines +1 to +9
[
{
"Input": "4cee90eb86eaa050036147a12d49004b6b9c72bd725d39d4785011fe190f0b4da73bd4903f0ce3b639bbbf6e8e80d16931ff4bcf5993d58468e8fb19086e8cac36dbcd03009df8c59286b162af3bd7fcc0450c9aa81be5d10d312af6c66b1d604aebd3099c618202fcfe16ae7770b0c49ab5eadf74b754204a3bb6060e44eff37618b065f9832de4ca6ca971a7a1adc826d0f7c00181a5fb2ddf79ae00b4e10e",
"Expected": "0000000000000000000000000000000000000000000000000000000000000001",
"Gas": 3450,
"Name": "CallP256Verify",
"NoBenchmark": false
}
]

Choose a reason for hiding this comment

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

Hi, thanks for preparing for the Fusaka! If you also consider implementing testdata, here is more extended version in a newer PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants