Skip to content

Conversation

@ilya-korotya
Copy link
Collaborator

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for TD1 (ID card) format to the existing passport verification system, which previously only supported TD3 (passport) format. The implementation includes utilities for building TD1 MRZ data, circuit inputs generation, and comprehensive test coverage.

  • Introduces TD1 document format support alongside existing TD3 passport format
  • Refactors existing code to share common functionality between TD1 and TD3
  • Implements new circuits and test suites for ID card verification

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
utils/passports/utils.ts New utility file with shared functions for TD1/TD3 MRZ building, signature generation, and document payload creation
utils/passports/genMockIdCardData.ts New function to generate mock ID card data for testing TD1 format
utils/passports/genMockPassportData.ts Refactored to use shared utilities from utils.ts, reducing code duplication
utils/passports/format.ts Added formatMrzTD1 function for TD1 format (90 chars) alongside existing formatMrzTD3 (88 chars)
utils/passports/passport_parsing/parsePassportData.ts Updated to handle both TD1 and TD3 formats with automatic detection based on MRZ length
utils/circuits/generateInputs.ts Added generateCircuitInputsIdCard function for TD1 circuit input generation
utils/hash.ts Improved error handling by throwing errors instead of falling back to defaults
circuits/idcard/idcard.circom New main ID card circuit implementing DG1FieldParser template for TD1 format
circuits/idcard/constants.circom New constants file defining TD1 field positions and sizes
circuits/idcard/instances/*.circom Circuit instances for different hash algorithms (sha1, sha224, sha256, sha384, sha512)
tests/idcard/idcard.test.ts Comprehensive test suite covering valid ID cards, expiration, and constraint validation
tests/idcard/test_cases.ts Test configuration for hash algorithms
package.json & yarn.lock Added @types/elliptic dependency for TypeScript type definitions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@daveroga daveroga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • yarn install doesn't work and produce errors. Update README replacing yarn install with pnpm install
  • Remove then yarn.lock and include pnpm-lock.yaml.
  • Maybe you need also to include build scripts for idcard circuits in this PR?
  • Maybe you need also to include integration scripts for idcard in this PR?

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.

3 participants