refactor: update RS256 circuit to enhance certificate verification#10
Open
vivianjeng wants to merge 6 commits intomainfrom
Open
refactor: update RS256 circuit to enhance certificate verification#10vivianjeng wants to merge 6 commits intomainfrom
vivianjeng wants to merge 6 commits intomainfrom
Conversation
- Changed the template name from `CertRSA256VerifyWithRevocation` to `FullCertRSA256VerifyWithRevocation` to reflect the expanded functionality. - Updated parameters to include a 2048-bit RSA key size and modified public input names for clarity. - Added utility functions for SHA256 padding verification and index selection. - Integrated issuer signature verification logic into the RS256 circuit implementation. - Introduced a new utility file for shared functions used across circuits. - Updated main circuit file to utilize the new template and adjusted public inputs accordingly.
- Removed zero-padded TBS input and actual TBS length parameters. - Added zero-padded user certificate input and actual user certificate length parameters for enhanced clarity and functionality. - Adjusted SHA256 padding verification to utilize the new user certificate inputs.
…TBS verification - Introduced new signals for issuer TBS length and user modulus offsets in the RS256 circuit. - Replaced SHA256 padding verification with a new TBS verification method to ensure accurate certificate validation. - Added a utility function to extract the RSA modulus from DER-encoded certificates, improving clarity and functionality. - Updated the circuit input structure to accommodate the new parameters for better handling of user certificates.
- Eliminated the user RSA modulus input from the FullCertRSA256VerifyWithRevocation template and the Rs256Circuit implementation for improved clarity. - Adjusted related input structures to streamline user certificate handling and maintain consistency across the circuit.
- Expanded the input JSON for RS256 to include detailed issuer RSA modulus, signature, and certificate parameters for enhanced clarity and functionality. - Commented out unused certificate parsing logic in the RS256 circuit implementation to streamline the code and improve maintainability. - Adjusted the structure to better accommodate the new input parameters, ensuring consistency across the circuit.
…handling - Renamed and adjusted input signals in the RS256 circuit to replace user certificate references with issuer TBS parameters for improved clarity. - Updated the input JSON structure to include the actual issuer TBS length and issuer TBS data, enhancing the overall functionality and consistency of the circuit. - Streamlined the circuit implementation to ensure accurate verification processes with the new issuer-related inputs.
Member
Author
|
Planned
|
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.
CertRSA256VerifyWithRevocationtoFullCertRSA256VerifyWithRevocationto reflect the expanded functionality.Description
Certificate Chain Structure
1.
VerifyTBSinCert— Bind full cert to issuer TBSWhy: Proves the
issuer_tbssignal is genuinely the TBS portion of the full user cert — not some attacker-supplied fake.2.
ExtractModulus— Pull user's public key from full certWhy: Extracts the user's RSA public key from the raw cert bytes. Offset hints are supplied by prover (Rust
parse_cert_offsets) and verified in-circuit by checking the ASN.1 tag byte.3. First
CertRSA256Verify— Verify user cert's own signatureWhy: Confirms the extracted modulus is correct — if
ExtractModulusreturned wrong bytes, this RSA verify would fail. Also confirms the user TBS is well-formed.4. Second
CertRSA256Verify— Verify issuer signed user certWhy: The core chain verification — proves the Issuer CA actually signed this user certificate.
5.
SMTNonMembershipVerifier— Check not revokedFull Proof Statement
Therefore: the user certificate was legitimately issued by the
trusted Issuer CA and has not been revoked.
Related Issue(s)
Other information
Checklist
Important
We do not accept pull requests for minor grammatical fixes (e.g., correcting typos, rewording sentences) or for fixing broken links, unless they significantly improve clarity or functionality. These contributions, while appreciated, are not a priority for merging. If you notice any of these issues, please create a GitHub Issue to report them so they can be properly tracked and addressed.