-
Notifications
You must be signed in to change notification settings - Fork 170
[cryptography] use aws-lc-rs for optimized secp256r1 verification #2684
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
[cryptography] use aws-lc-rs for optimized secp256r1 verification #2684
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
commonware-mcp | 266c93c | Jan 03 2026, 07:19 PM |
40fe594 to
86fbf15
Compare
Deploying monorepo with
|
| Latest commit: |
266c93c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d9ee1813.monorepo-eu0.pages.dev |
| Branch Preview URL: | https://only-instrument-workspace.monorepo-eu0.pages.dev |
920cbb1 to
9e638f8
Compare
The p256 crate (used for secp256r1) is pure Rust with no assembly/C backend, unlike blst (BLS12-381) which uses C with assembly, or ed25519-consensus which has optimized backends. When LLVM coverage instrumentation was applied via RUSTFLAGS, all Rust code including dependencies got instrumented. The tight cryptographic loops in p256 became significantly slower due to instrumentation overhead, causing the 1000-view secp256r1 tests to timeout. This change uses RUSTC_WORKSPACE_WRAPPER to only instrument workspace crates, not dependencies. A wrapper script adds the coverage flags only when invoked by Cargo for workspace crates, leaving dependencies uninstrumented. Fixes #2681 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
9e638f8 to
9972965
Compare
- Add aws-lc-rs dependency for x86_64 and aarch64 platforms - Use aws-lc-rs for P-256 ECDSA verification (~4-6x faster) - Keep p256 for signing (preserves RFC 6979 deterministic signatures) - Automatic platform detection (no feature flag needed) - Falls back to p256 on unsupported platforms (WASM, etc.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
fd8d2bb
into
andre/exclude-1k-secp256r1-test-coverage
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## andre/exclude-1k-secp256r1-test-coverage #2684 +/- ##
=========================================================================
Coverage 92.77% 92.77%
=========================================================================
Files 362 362
Lines 105109 105115 +6
=========================================================================
+ Hits 97518 97525 +7
+ Misses 7591 7590 -1
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Uses aws-lc-rs for secp256r1 signature verification on x86_64 and aarch64. This provides a C/assembly backend similar to blst (BLS12-381), significantly improving on the performance of pure-Rust p256.
We still retain p256 for signing (for RFC6979) and for recoverable signatures. Falls back to the p256 crate on other architectures (e.g., wasm32).
Fixes #2681
Performance