Skip to content
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

ECDSA With SHA1 & SHA256 Support #159

Merged
merged 17 commits into from
Jul 31, 2024
Merged

ECDSA With SHA1 & SHA256 Support #159

merged 17 commits into from
Jul 31, 2024

Conversation

0xVikasRushi
Copy link
Member

@0xVikasRushi 0xVikasRushi commented Jul 28, 2024

ECDSA With SHA1 & SHA256 Support

This pr implements passport verification using P256 ECDSA.

Changes

1. P256 ECDSA Imports

  • Added necessary imports to support P256 ECDSA operations.

2. Input Processing and Leaf Calculation (getLeaf function)

  • Implemented ECDSA cases.
  • For ECDSA:
    • Extracts x and y coordinates from the public key.
    • Uses Poseidon6 to hash x and y coordinates separately.
    • Applies Poseidon3 to combine hashed coordinates with signature algorithm identifier.

3. Verifier Circuit

  • Addedpassport_verifier_ecdsaWithSHA1Encryption.circom
  • Added passport_verifier_ecdsaWithSHA256Encryption.circom
  • Uses dsc_modules[2][k] structure where k is the number of bits.
  • Processes signature_r and signature_s components.

4. Register Circuit

  • Addedregister_ecdsaWithSHA1Encryption.circom
  • Added register_ecdsaWithSHA256Encryption.circom
  • commitment hash similar to typescript leak calculation
  • Added Verifier circuit logic for signature constraint
  • Added test for valid commitment calculation, invalid signature, econtent and mrz checks

@0xVikasRushi 0xVikasRushi changed the title ECDSA With SHA1 Support ECDSA With SHA1 & SHA256 Support Jul 30, 2024
@remicolin
Copy link
Member

lgtm

@remicolin remicolin merged commit ce89661 into dev Jul 31, 2024
1 check passed
@0xturboblitz 0xturboblitz deleted the sha1-with-ecdsa branch August 20, 2024 20:29
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.

2 participants