-
Notifications
You must be signed in to change notification settings - Fork 21
EIP-7951: Precompile for secp256r1 Curve Support #817
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
EIP-7951: Precompile for secp256r1 Curve Support #817
Conversation
.../call/precompiles/modexp/common/__05__exponent_leading_word_extraction_and_analysis_row.lisp
Show resolved
Hide resolved
.../call/precompiles/modexp/common/__05__exponent_leading_word_extraction_and_analysis_row.lisp
Outdated
Show resolved
Hide resolved
.../call/precompiles/modexp/common/__05__exponent_leading_word_extraction_and_analysis_row.lisp
Show resolved
Hide resolved
hub/osaka/constraints/instruction-handling/call/precompiles/NSRs_and_flag_sums_I.lisp
Outdated
Show resolved
Hide resolved
hub/osaka/constraints/instruction-handling/call/precompiles/NSRs_and_flag_sums_II.lisp
Outdated
Show resolved
Hide resolved
oob/osaka/precompiles/common/post_cancun/point_evaluation_bls_adds_bls_maps_p256_verify.lisp
Outdated
Show resolved
Hide resolved
oob/osaka/precompiles/common/post_cancun/point_evaluation_bls_adds_bls_maps_p256_verify.lisp
Outdated
Show resolved
Hide resolved
9bbfdce to
aeb7677
Compare
e2e3261 to
2348a08
Compare
hub/osaka/constraints/instruction-handling/call/precompiles/NSRs_and_flag_sums_II.lisp
Outdated
Show resolved
Hide resolved
hub/osaka/constraints/instruction-handling/call/precompiles/NSRs_and_flag_sums_II.lisp
Outdated
Show resolved
Hide resolved
hub/osaka/constraints/instruction-handling/call/precompiles/NSRs_and_flag_sums_II.lisp
Show resolved
Hide resolved
...straints/instruction-handling/call/precompiles/common/success_ECRECOVER_and_P256_VERIFY.lisp
Outdated
Show resolved
Hide resolved
hub/osaka/constraints/instruction-handling/call/precompiles/NSRs_and_flag_sums_II.lisp
Outdated
Show resolved
Hide resolved
| P_x_cube_plus_a_times_P_x_lo) | ||
| (eq! P_is_in_range (* P_x_is_in_range P_y_is_in_range)) | ||
| (eq! R1_membership | ||
| (* P_is_in_range (- 1 P_is_point_at_infinity) P_satisfies_cubic)) |
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.
Bug: R1 membership incorrectly rejects point at infinity
The R1_membership calculation uses (* P_is_in_range (- 1 P_is_point_at_infinity) P_satisfies_cubic) which incorrectly rejects the point at infinity. This differs from C1_membership which correctly uses (* P_is_in_range (+ P_is_point_at_infinity P_satisfies_cubic)) to accept either the point at infinity or points satisfying the curve equation. The secp256r1 curve should accept the point at infinity as valid, so the formula needs (+ P_is_point_at_infinity P_satisfies_cubic) instead of (- 1 P_is_point_at_infinity) P_satisfies_cubic.
Note
Introduce P256_VERIFY (secp256r1) precompile end-to-end, with constants, phases, OOB opcode, ECData/OOB/Hub constraints, and scenario/plumbing; also refactor/adjust related selectors and ECRECOVER checks.
P256_VERIFYprecompile: gas cost (GAS_CONST_P256_VERIFY), call/return sizes, phases (PHASE_P256_VERIFY_*), and OOB opcode (OOB_INST_P256_VERIFY).IS_P256_VERIFY_*and circuit selectorCIRCUIT_SELECTOR_P256_VERIFY.R1field params, membership helpers).PRC_P256_VERIFYand integrate into NSR/flag sums, GAS/NSR, success/failure justifications, and MMU transfers.ECRECOVERfor full/partial return handling; extend common generalities and sanity checks to Osaka.IS_P256_VERIFY,CT_MAX_P256_VERIFY; integrate into weighted sums, phases, and ct-max.flag_sums,inst_sums,ctmax_sums,lookup_sums.ct-max-sum(rename frommaxct-sum).ECRECOVERtoISZEROand adjust success-bit logic.defcomputedcolumnand tighten selector binarity property.constants/constants.lisp.Written by Cursor Bugbot for commit 3c4fc31. This will update automatically on new commits. Configure here.