Add hinted P-384 Nitro attestation verification for Fusaka#28
Open
leanthebean wants to merge 2 commits into
Open
Add hinted P-384 Nitro attestation verification for Fusaka#28leanthebean wants to merge 2 commits into
leanthebean wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a hinted P-384 verification path for AWS Nitro Enclave attestations so the full on-chain verification flow can fit under the Fusaka per-transaction gas cap without requiring a new P-384 precompile or a ZK proof system.
The core change is to make P-384 modular inversions hint-aware. Instead of computing each inverse on-chain with 384-bit
MODEXP, the caller supplies the inverse as calldata and the contract verifies it before use:Malformed, truncated, or surplus hints revert. The hints are public and fully constrained, so they are liveness-critical but not trust-critical.
What Changed
P384Verifier, an external verifier wrapper used by both cert and attestation validation.ECDSA384implementation in thesolidity-libsubmodule fork to supportverifyWithHints.CertManagerto use hinted P-384 verification for CA certs, client / leaf certs, and certificate caching.NitroValidatorto use hinted verification for the final COSE attestation document signature.verifyCACertverifyClientCertvalidateAttestationtools/p384_hints.jstools/hinted_attestation_calls.jstools/nitro_attestation_input.jsscript/BaseSepoliaDemo.s.soldocs/hinted-p384-nitro-attestation.mdVerification Flow
The AWS Nitro root CA is pinned in
CertManagerat deployment and is not signature-verified on-chain.For the bundled real attestation fixture, the cold path is:
Once the CA chain and leaf cert are cached and unexpired, the warm path is one
transaction:
The cache is keyed by
keccak256(cert)and reused globally on-chain until certificate expiry.Measured Gas
Measured from successful Base Sepolia receipts after Fusaka upgrade. These numbers exclude one-time deployments.
Representative Base Sepolia tx hashes:
0x2cb00a86b943a29cda28be89ad990d9ca29c502c8350ba1ab89e726d44d6702e0x0563932374215073fd92f8d79920af0f5d79be25c92d26bab910de8bb16a21c7Audit Notes
The cryptographic trust delta is intentionally narrow:
n;p;inverse hint underflow;unused inverse hints;bad inverse hint.The rest of the P-384 verifier path remains the upstream
ECDSA384logic: scalar bounds, on-curve checks, Strauss-Shamir ladder, low-s handling, and finalx_R == racceptance behavior.Testing
Passing locally:
The Forge suite covers:
Caveats
CertManagerDemowith an expiry grace window for an old real attestation fixture. Production deployments should use strictCertManagervalidity checks.