-
Notifications
You must be signed in to change notification settings - Fork 0
support td1 #37
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
base: main
Are you sure you want to change the base?
support td1 #37
Conversation
There was a problem hiding this 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.
daveroga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn installdoesn't work and produce errors. UpdateREADMEreplacingyarn installwithpnpm install- Remove then
yarn.lockand includepnpm-lock.yaml. - Maybe you need also to include build scripts for
idcardcircuits in this PR? - Maybe you need also to include integration scripts for
idcardin this PR?
No description provided.