Skip to content

feat(precompile): add aws-lc-rs as alternative backend for secp256r1#3451

Merged
rakita merged 5 commits intomainfrom
aws-precompile
Mar 2, 2026
Merged

feat(precompile): add aws-lc-rs as alternative backend for secp256r1#3451
rakita merged 5 commits intomainfrom
aws-precompile

Conversation

@rakita
Copy link
Copy Markdown
Member

@rakita rakita commented Feb 27, 2026

Summary

  • Adds p256-aws-lc-rs feature flag to use aws-lc-rs instead of the pure Rust p256 crate for secp256r1 (P256) signature verification
  • The p256 crate remains the default for portability (zkVMs, wasm targets)
  • Uses Digest::import_less_safe + UnparsedPublicKey::verify_digest for prehash verification

Closes #3417

Test plan

  • All 18 unit tests in secp256r1::test pass with p256-aws-lc-rs feature
  • All Ethereum P256 state tests pass (eip7951_p256verify_precompiles/ — valid, invalid, wycheproof, gas, call types, etc.)
  • Default p256 backend still works and passes all tests
  • cargo fmt and cargo clippy clean

Add `p256-aws-lc-rs` feature flag to use aws-lc-rs instead of the pure
Rust p256 crate for secp256r1 (P256) signature verification. The p256
crate remains the default for portability (including zkVMs/wasm).
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 27, 2026

Merging this PR will not alter performance

✅ 176 untouched benchmarks


Comparing aws-precompile (745581a) with main (f06cdd8)

Open in CodSpeed

@rakita
Copy link
Copy Markdown
Member Author

rakita commented Feb 27, 2026

feature was made default and CI passed with it. Fine to merge it

@rakita rakita changed the title feat(precompile): add aws-lc-rs as alternative backend for secp256r1 feat(precompile): add aws-lc-rs and herumi/mcl as alternative precompile backends Feb 27, 2026
@rakita rakita changed the title feat(precompile): add aws-lc-rs and herumi/mcl as alternative precompile backends feat(precompile): add aws-lc-rs as alternative backend for secp256r1 Feb 27, 2026
@mcmoodoo
Copy link
Copy Markdown

@rakita , will this merge fix #3417 entirely?

Thanks

@rakita
Copy link
Copy Markdown
Member Author

rakita commented Mar 2, 2026

it is behind the feature flag, so it is safe to merge

@rakita rakita merged commit b6d06d1 into main Mar 2, 2026
61 checks passed
@rakita rakita deleted the aws-precompile branch March 2, 2026 03:30
@github-actions github-actions bot mentioned this pull request Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add aws-lc-rs as alternative to secp256r1 precompile

2 participants