- Notifications
You must be signed in to change notification settings - Fork 333
Implement secp256r1/P256 signature verification (EIP-7951) #1321
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## master #1321 +/- ## ========================================== + Coverage 87.04% 87.06% +0.01% ========================================== Files 167 168 +1 Lines 24728 24788 +60 Branches 4064 4070 +6 ========================================== + Hits 21525 21582 +57 Misses 547 547 - Partials 2656 2659 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
pdobacz left a comment
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.
👍 👍
Add implementation of the "dbl-2001-b" doubling formula from https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b.
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.
Pull Request Overview
This PR implements the secp256r1/P256 signature verification precompile according to EIP-7951, which adds cryptographic support for the P256 elliptic curve commonly used in modern cryptographic applications.
- Adds a new secp256r1 module with curve parameters and signature verification logic
- Implements the p256verify_execute function to handle signature verification requests
- Extends the ECC library to support curves with A ≠ 0 (specifically A = P-3 for secp256r1)
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/state/precompiles.cpp | Implements the p256verify_execute precompile function with input validation and signature verification |
| lib/evmone_precompiles/secp256r1.hpp | Defines secp256r1 curve parameters and verification function interface |
| lib/evmone_precompiles/secp256r1.cpp | Implements ECDSA signature verification algorithm for secp256r1 curve |
| lib/evmone_precompiles/ecc.hpp | Extends ECC library to support curves with A = P-3 by adding conditional doubling formulas |
| lib/evmone_precompiles/CMakeLists.txt | Adds secp256r1 source files to build configuration |
| circle.yml | Removes test filters that were excluding p256verify precompile tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This implements the `p256_verify` precompile which verifies an ECDSA signature from the P256 / secp256r1 curve. See EIP-7951: https://eips.ethereum.org/EIPS/eip-7951.
This implements the
p256_verifyprecompile which verifiesan ECDSA signature from the P256 / secp256r1 curve.
See EIP-7951: https://eips.ethereum.org/EIPS/eip-7951.