Skip to content

Commit

Permalink
Merge branch 'dev' into new-samples
Browse files Browse the repository at this point in the history
  • Loading branch information
0xturboblitz authored Aug 3, 2024
2 parents 3c3763c + 74740fa commit 57c40e6
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ template Register_ecdsaWithSHA1Encryption(n, k, max_datahashes_bytes, nLevels, s
signal output commitment <== poseidon_hasher.out;
}

// We hardcode 7 here for ecdsa_with_SHA1
component main { public [ attestation_id ] } = Register_ecdsaWithSHA1Encryption(43, 6, 320, 16, 7);
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ template Register_ecdsaWithSHA256Encryption(n, k, max_datahashes_bytes, nLevels,
signal output commitment <== poseidon_hasher.out;
}

// We hardcode 8 here for ecdsa_with_SHA256
component main { public [ attestation_id ] } = Register_ecdsaWithSHA256Encryption(43, 6, 320, 16, 8);
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ template Register_sha1WithRSAEncryption_65537(n, k, max_datahashes_bytes, nLevel

}

// We hardcode 1 here for sha1WithRSAEncryption_65537
// We hardcode 3 here for sha1WithRSAEncryption_65537
component main { public [ attestation_id ] } = Register_sha1WithRSAEncryption_65537(121, 17, 320, 16, 3);
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ template register_sha256WithRSASSAPSS_65537(n, k, max_datahashes_bytes, nLevels,

}

// We hardcode 1 here for sha256WithRSAEncryption_65537
// We hardcode 4 here for sha256WithRSASSAPSS_65537
component main { public [ attestation_id ] } = register_sha256WithRSASSAPSS_65537(64, 32, 320, 16, 4);

This file was deleted.

4 changes: 2 additions & 2 deletions circuits/tests/register/register_sha1_ecdsa.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe } from 'mocha';
import path from 'path';
import { poseidon1, poseidon6 } from 'poseidon-lite';
import { mockPassPortData_sha1_ecdsa } from '../../../common/src/constants/mockPassportData';
import { mockPassportData_sha1_ecdsa } from '../../../common/src/constants/mockPassportData';
import { generateCircuitInputsRegister } from '../../../common/src/utils/generateInputs';
import {
BigintToArray,
Expand All @@ -17,7 +17,7 @@ describe('Register - SHA1 WITH ECDSA', function () {
this.timeout(0);
let inputs: any;
let circuit: any;
let passportData = mockPassPortData_sha1_ecdsa;
let passportData = mockPassportData_sha1_ecdsa;
let attestation_id: string;
const attestation_name = 'E-PASSPORT';
const n_dsc = 43; // 43 * 6 = 258 > 254 Cirom field size
Expand Down
2 changes: 1 addition & 1 deletion circuits/tests/register/register_sha1_rsa.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Register - SHA1 RSA', function () {
'./node_modules/@zk-kit/binary-merkle-root.circom/src',
'./node_modules/circomlib/circuits',
'./node_modules/dmpierre/sha1-circom/circuits',
'./node_modules/@zk-email/circuits ',
'./node_modules/@zk-email/circuits',
],
}
);
Expand Down
5 changes: 3 additions & 2 deletions common/src/constants/mockPassportData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export const mockPassportData_sha384_ecdsa = {
photoBase64: 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABjElEQVR42mL8//8/AyUYiBQYmIw3...',
};

export const mockPassPortData_sha1_ecdsa = {
export const mockPassportData_sha1_ecdsa = {
mrz: 'P<FRADUPONT<<ALPHONSE<HUGUES<ALBERT<<<<<<<<<24HB818324FRA0402111M3111115<<<<<<<<<<<<<<02',
signatureAlgorithm: 'ecdsa-with-SHA1',
pubKey: {
Expand Down Expand Up @@ -344,9 +344,10 @@ export const mockPassportData_sha512_ecdsa = {

export const mockPassportDatas = [
mockPassportData_sha256_rsa_65537,
mockPassportData_sha256_sha1MRZ_rsa_65537,
mockPassportData_sha1_rsa_65537,
mockPassportData_sha256_rsapss_65537,
mockPassPortData_sha1_ecdsa,
mockPassportData_sha1_ecdsa,
mockPassportData_sha256_ecdsa,
mockPassportData_sha512_ecdsa,
// mockPassportData_SHA384withECDSA, // temp cause formatting of ecdsa key is not done well now
Expand Down

0 comments on commit 57c40e6

Please sign in to comment.