diff --git a/circuits/circuits/dsc/dsc.circom b/circuits/circuits/dsc/dsc.circom index b0744ef2..3e83feb6 100644 --- a/circuits/circuits/dsc/dsc.circom +++ b/circuits/circuits/dsc/dsc.circom @@ -9,7 +9,8 @@ include "@zk-kit/binary-merkle-root.circom/src/binary-merkle-root.circom"; include "../utils/passport/customHashers.circom"; include "../utils/passport/signatureAlgorithm.circom"; include "../utils/passport/signatureVerifier.circom"; -include "@zk-email/circuits/utils/bytes.circom"; +include "@openpassport/zk-email-circuits/utils/bytes.circom"; +include "../utils/crypto/bitify/bytes.circom"; template DSC(signatureAlgorithm, n_dsc, k_dsc, n_csca, k_csca, max_cert_bytes, dscPubkeyBytesLength, nLevels) { diff --git a/circuits/circuits/utils/crypto/bigInt/bigInt.circom b/circuits/circuits/utils/crypto/bigInt/bigInt.circom index f4c217e2..2bd7d041 100644 --- a/circuits/circuits/utils/crypto/bigInt/bigInt.circom +++ b/circuits/circuits/utils/crypto/bigInt/bigInt.circom @@ -70,7 +70,7 @@ template BigMultModP(CHUNK_SIZE, CHUNK_NUMBER_GREATER, CHUNK_NUMBER_LESS, CHUNK_ mult2.in1 <== modulus; } - component isZero = BigIntIsZero(CHUNK_SIZE, CHUNK_SIZE * 2 + log_ceil_dl(CHUNK_NUMBER_MODULUS + CHUNK_NUMBER_DIV - 1), CHUNK_NUMBER_BASE - 1); + component isZero = BigIntIsZero(CHUNK_SIZE, CHUNK_SIZE * 2 + log_ceil(CHUNK_NUMBER_MODULUS + CHUNK_NUMBER_DIV - 1), CHUNK_NUMBER_BASE - 1); for (var i = 0; i < CHUNK_NUMBER_MODULUS; i++) { isZero.in[i] <== mult.out[i] - mult2.out[i] - mod[i]; } diff --git a/circuits/circuits/utils/crypto/bigInt/bigIntFunc.circom b/circuits/circuits/utils/crypto/bigInt/bigIntFunc.circom index f8d37abd..93fc6476 100644 --- a/circuits/circuits/utils/crypto/bigInt/bigIntFunc.circom +++ b/circuits/circuits/utils/crypto/bigInt/bigIntFunc.circom @@ -1,39 +1,7 @@ pragma circom 2.1.6; - +include "circom-bigint/circuits/bigint_func.circom"; include "./shouldUseKaratsuba.circom"; -function is_negative_dl(x) { - return x > 10944121435919637611123202872628637544274182200208017171849102093287904247808 ? 1 : 0; -} - -function div_ceil_dl(m, n) { - var ret = 0; - if (m % n == 0) { - ret = m \ n; - } else { - ret = m \ n + 1; - } - return ret; -} - -function log_ceil_dl(n) { - var n_temp = n; - for (var i = 0; i < 254; i++) { - if (n_temp == 0) { - return i; - } - n_temp = n_temp \ 2; - } - return 254; -} - -function SplitFn_dl(in, n, m) { - return [in % (1 << n), (in \ (1 << n)) % (1 << m)]; -} - -function SplitThreeFn_dl(in, n, m, k) { - return [in % (1 << n), (in \ (1 << n)) % (1 << m), (in \ (1 << n + m)) % (1 << k)]; -} // in is an m bit number // split into ceil(m/n) n-bit registers @@ -44,7 +12,7 @@ function splitOverflowedRegister_dl(m, n, in) { out[i] = 0; } - var nRegisters = div_ceil_dl(m, n); + var nRegisters = div_ceil(m, n); var running = in; for (var i = 0; i < nRegisters; i++) { out[i] = running % (1 << n); @@ -74,7 +42,7 @@ function getProperRepresentation_dl(m, n, k, in) { for (var j = 0; j < 200; j++) { pieces[i][j] = 0; } - if (is_negative_dl(in[i]) == 1) { + if (isNegative(in[i]) == 1) { var negPieces[200] = splitOverflowedRegister_dl(m, n, - 1 * in[i]); for (var j = 0; j < ceilMN; j++) { pieces[i][j] = - 1 * negPieces[j]; @@ -108,7 +76,7 @@ function getProperRepresentation_dl(m, n, k, in) { } } - if (is_negative_dl(thisRegisterValue) == 1) { + if (isNegative(thisRegisterValue) == 1) { var thisRegisterAbs = - 1 * thisRegisterValue; out[registerIdx] = (1 << n) - (thisRegisterAbs % (1 << n)); carries[registerIdx] = - 1 * (thisRegisterAbs >> n) - 1; @@ -121,19 +89,6 @@ function getProperRepresentation_dl(m, n, k, in) { return out; } -// 1 if true, 0 if false -function long_gt_dl(n, k, a, b) { - for (var i = k - 1; i >= 0; i--) { - if (a[i] > b[i]) { - return 1; - } - if (a[i] < b[i]) { - return 0; - } - } - return 0; -} - // n bits per register // a has k registers // b has k registers @@ -293,9 +248,9 @@ function short_div_norm_dl(n, k, a, b) { } var mult[200] = long_scalar_mult_dl(n, k, qhat, b); - if (long_gt_dl(n, k + 1, mult, a) == 1) { + if (long_gt(n, k + 1, mult, a) == 1) { mult = long_sub_dl(n, k + 1, mult, b); - if (long_gt_dl(n, k + 1, mult, a) == 1) { + if (long_gt(n, k + 1, mult, a) == 1) { return qhat - 2; } else { return qhat - 1; @@ -352,20 +307,20 @@ function prod_dl(n, k, a, b) { var split[200][3]; for (var i = 0; i < 2 * k - 1; i++) { - split[i] = SplitThreeFn_dl(prod_val[i], n, n, n); + split[i] = SplitThreeFn(prod_val[i], n, n, n); } var carry[200]; carry[0] = 0; out[0] = split[0][0]; if (2 * k - 1 > 1) { - var sumAndCarry[2] = SplitFn_dl(split[0][1] + split[1][0], n, n); + var sumAndCarry[2] = SplitFn(split[0][1] + split[1][0], n, n); out[1] = sumAndCarry[0]; carry[1] = sumAndCarry[1]; } if (2 * k - 1 > 2) { for (var i = 2; i < 2 * k - 1; i++) { - var sumAndCarry[2] = SplitFn_dl(split[i][0] + split[i - 1][1] + split[i - 2][2] + carry[i - 1], n, n); + var sumAndCarry[2] = SplitFn(split[i][0] + split[i - 1][1] + split[i - 2][2] + carry[i - 1], n, n); out[i] = sumAndCarry[0]; carry[i] = sumAndCarry[1]; } @@ -465,7 +420,7 @@ function mod_inv_dl(n, k, a, p) { // a, b and out are all n bits k registers function long_sub_mod_p_dl(n, k, a, b, p){ - var gt = long_gt_dl(n, k, a, b); + var gt = long_gt(n, k, a, b); var tmp[200]; if (gt){ tmp = long_sub_dl(n, k, a, b); @@ -503,7 +458,7 @@ function long_add_dl(CHUNK_SIZE, CHUNK_NUMBER, A, B){ var carry = 0; var sum[200]; for (var i = 0; i < CHUNK_NUMBER; i++){ - var sumAndCarry[2] = SplitFn_dl(A[i] + B[i] + carry, CHUNK_SIZE, CHUNK_SIZE); + var sumAndCarry[2] = SplitFn(A[i] + B[i] + carry, CHUNK_SIZE, CHUNK_SIZE); sum[i] = sumAndCarry[0]; carry = sumAndCarry[1]; } @@ -513,7 +468,7 @@ function long_add_dl(CHUNK_SIZE, CHUNK_NUMBER, A, B){ function long_sub_mod_dl(CHUNK_SIZE, CHUNK_NUMBER, A, B, P) { - if (long_gt_dl(CHUNK_SIZE, CHUNK_NUMBER, B, A) == 1){ + if (long_gt(CHUNK_SIZE, CHUNK_NUMBER, B, A) == 1){ return long_add_dl(CHUNK_SIZE, CHUNK_NUMBER, A, long_sub_dl(CHUNK_SIZE,CHUNK_NUMBER,P,B)); } else { return long_sub_dl(CHUNK_SIZE, CHUNK_NUMBER, A, B); @@ -630,7 +585,7 @@ function is_karatsuba_optimal_dl(a, b){ return 0; } -function is_negative_chunk_dl(x, n) { +function isNegative_chunk_dl(x, n) { var x2 = x; for (var i = 0; i < n; i++){ x2 = x2 \ 2; @@ -649,7 +604,7 @@ function reduce_overflow_signed_dl(n, k, k2, max_n, in){ clone[i] = in[i]; } for (var i = 0; i < k2; i++){ - if (is_negative_chunk_dl(clone[i], max_n) == 0){ + if (isNegative_chunk_dl(clone[i], max_n) == 0){ out[i] = clone[i] % 2 ** n; clone[i + 1] += clone[i] \ 2 ** n; } else { @@ -674,7 +629,7 @@ function reduce_overflow_signed_dl(n, k, k2, max_n, in){ } for (var i = 0; i < k2; i++){ - if (is_negative_chunk_dl(clone[i], max_n) == 0){ + if (isNegative_chunk_dl(clone[i], max_n) == 0){ out[i] = clone[i] % 2 ** n; clone[i + 1] += clone[i] \ 2 ** n; } else { diff --git a/circuits/circuits/utils/crypto/bitify/bytes.circom b/circuits/circuits/utils/crypto/bitify/bytes.circom new file mode 100644 index 00000000..169bf43f --- /dev/null +++ b/circuits/circuits/utils/crypto/bitify/bytes.circom @@ -0,0 +1,34 @@ +// NOTE: this circuit is unaudited and should not be used in production +/// @title SplitBytesToWords +/// @notice split an array of bytes into an array of words +/// @notice useful for casting a message or modulus before RSA verification +/// @param l: number of bytes in the input array +/// @param n: number of bits in a word +/// @param k: number of words +/// @input in: array of bytes +/// @output out: array of words +template SplitBytesToWords (l,n,k) { + signal input in[l]; + signal output out[k]; + + component num2bits[l]; + for (var i = 0 ; i < l ; i++){ + num2bits[i] = Num2Bits(8); + num2bits[i].in <== in[i]; + } + component bits2num[k]; + for (var i = 0 ; i < k ; i++){ + bits2num[i] = Bits2Num(n); + for(var j = 0 ; j < n ; j++){ + if(i*n + j >= 8 * l){ + bits2num[i].in[j] <== 0; + } + else{ + bits2num[i].in[j] <== num2bits[l - (( i * n + j) \ 8) - 1].out[ ((i * n + j) % 8)]; + } + } + } + for( var i = 0 ; i< k ; i++){ + out[i] <== bits2num[i].out; + } +} \ No newline at end of file diff --git a/circuits/circuits/utils/crypto/hasher/sha2/sha224/sha224HashChunks.circom b/circuits/circuits/utils/crypto/hasher/sha2/sha224/sha224HashChunks.circom index 1b8d21e3..2e033384 100644 --- a/circuits/circuits/utils/crypto/hasher/sha2/sha224/sha224HashChunks.circom +++ b/circuits/circuits/utils/crypto/hasher/sha2/sha224/sha224HashChunks.circom @@ -3,7 +3,7 @@ pragma circom 2.0.0; include "../sha2Common.circom"; include "../sha256/sha256Schedule.circom"; include "../sha256/sha256Rounds.circom"; -include "@zk-email/circuits/utils/array.circom"; +include "@openpassport/zk-email-circuits/utils/array.circom"; include "sha224InitialValue.circom"; template Sha224HashChunks(MAX_BLOCKS) { diff --git a/circuits/circuits/utils/crypto/hasher/sha2/sha384/sha384HashChunks.circom b/circuits/circuits/utils/crypto/hasher/sha2/sha384/sha384HashChunks.circom index d2cc7166..f01bbed6 100644 --- a/circuits/circuits/utils/crypto/hasher/sha2/sha384/sha384HashChunks.circom +++ b/circuits/circuits/utils/crypto/hasher/sha2/sha384/sha384HashChunks.circom @@ -3,7 +3,7 @@ pragma circom 2.0.0; include "../sha2Common.circom"; include "../sha512/sha512Schedule.circom"; include "../sha512/sha512Rounds.circom"; -include "@zk-email/circuits/utils/array.circom"; +include "@openpassport/zk-email-circuits/utils/array.circom"; include "sha384InitialValue.circom"; template Sha384HashChunks(MAX_BLOCKS) { diff --git a/circuits/circuits/utils/crypto/hasher/sha2/sha512/sha512HashChunks.circom b/circuits/circuits/utils/crypto/hasher/sha2/sha512/sha512HashChunks.circom index 67507a08..24e186b2 100644 --- a/circuits/circuits/utils/crypto/hasher/sha2/sha512/sha512HashChunks.circom +++ b/circuits/circuits/utils/crypto/hasher/sha2/sha512/sha512HashChunks.circom @@ -3,7 +3,7 @@ pragma circom 2.0.0; include "../sha2Common.circom"; include "sha512InitialValue.circom"; include "sha512Schedule.circom"; -include "@zk-email/circuits/utils/array.circom"; +include "@openpassport/zk-email-circuits/utils/array.circom"; include "sha512Rounds.circom"; template Sha512HashChunks(MAX_BLOCKS) { diff --git a/circuits/circuits/utils/crypto/hasher/shaBytes/dynamic/sha1Bytes.circom b/circuits/circuits/utils/crypto/hasher/shaBytes/dynamic/sha1Bytes.circom index fb687c09..d4561605 100644 --- a/circuits/circuits/utils/crypto/hasher/shaBytes/dynamic/sha1Bytes.circom +++ b/circuits/circuits/utils/crypto/hasher/shaBytes/dynamic/sha1Bytes.circom @@ -2,10 +2,10 @@ pragma circom 2.1.5; include "../../sha1/sha1compression.circom"; include "../../sha1/constants.circom"; -include "@zk-email/circuits/utils/array.circom"; +include "@openpassport/zk-email-circuits/utils/array.circom"; include "circomlib/circuits/bitify.circom"; -//Adapted from @zk-email/circuits/helpers/sha.circom +//Adapted from @openpassport/zk-email-circuits/helpers/sha.circom template Sha1Bytes(max_num_bytes) { signal input in_padded[max_num_bytes]; signal input in_len_padded_bytes; @@ -31,7 +31,7 @@ template Sha1Bytes(max_num_bytes) { } -//Adapted from @zk-email/circuits/helpers/sha256general.circom +//Adapted from @openpassport/zk-email-circuits/helpers/sha256general.circom //Sha1 template from https://github.com/dmpierre/sha1-circom/blob/fe18319cf72b9f3b83d0cea8f49a1f04482c125b/circuits/sha1.circom template Sha1General(maxBitsPadded) { assert(maxBitsPadded % 512 == 0); diff --git a/circuits/circuits/utils/crypto/hasher/shaBytes/shaBytesDynamic.circom b/circuits/circuits/utils/crypto/hasher/shaBytes/shaBytesDynamic.circom index 52311d0d..b29df2cb 100644 --- a/circuits/circuits/utils/crypto/hasher/shaBytes/shaBytesDynamic.circom +++ b/circuits/circuits/utils/crypto/hasher/shaBytes/shaBytesDynamic.circom @@ -2,7 +2,7 @@ pragma circom 2.1.9; include "./dynamic/sha1Bytes.circom"; include "./dynamic/sha224Bytes.circom"; -include "@zk-email/circuits/lib/sha.circom"; +include "@openpassport/zk-email-circuits/lib/sha.circom"; include "./dynamic/sha384Bytes.circom"; include "./dynamic/sha512Bytes.circom"; diff --git a/circuits/circuits/utils/crypto/merkle-trees/smt.circom b/circuits/circuits/utils/crypto/merkle-trees/smt.circom index a54c7ae8..a2836b98 100644 --- a/circuits/circuits/utils/crypto/merkle-trees/smt.circom +++ b/circuits/circuits/utils/crypto/merkle-trees/smt.circom @@ -2,7 +2,7 @@ pragma circom 2.1.9; include "circomlib/circuits/comparators.circom"; include "circomlib/circuits/bitify.circom"; -include "@zk-email/circuits/utils/array.circom"; +include "@openpassport/zk-email-circuits/utils/array.circom"; include "@zk-kit/binary-merkle-root.circom/src/binary-merkle-root.circom"; include "circomlib/circuits/poseidon.circom"; diff --git a/circuits/circuits/utils/crypto/signature/FpPowMod.circom b/circuits/circuits/utils/crypto/signature/FpPowMod.circom index af3af64a..61c26a14 100644 --- a/circuits/circuits/utils/crypto/signature/FpPowMod.circom +++ b/circuits/circuits/utils/crypto/signature/FpPowMod.circom @@ -1,6 +1,6 @@ pragma circom 2.1.9; -include "@zk-email/circuits/lib/fp.circom"; +include "@openpassport/zk-email-circuits/lib/fp.circom"; include "circomlib/circuits/bitify.circom"; /// @title FpPow3Mod diff --git a/circuits/circuits/utils/crypto/signature/rsa/verifyRsa3Pkcs1v1_5.circom b/circuits/circuits/utils/crypto/signature/rsa/verifyRsa3Pkcs1v1_5.circom index 965d8d3d..b2e16d53 100644 --- a/circuits/circuits/utils/crypto/signature/rsa/verifyRsa3Pkcs1v1_5.circom +++ b/circuits/circuits/utils/crypto/signature/rsa/verifyRsa3Pkcs1v1_5.circom @@ -1,6 +1,6 @@ pragma circom 2.1.9; -include "@zk-email/circuits/lib/fp.circom"; +include "@openpassport/zk-email-circuits/lib/fp.circom"; include "./pkcs1v1_5Padding.circom"; include "../FpPowMod.circom"; diff --git a/circuits/circuits/utils/crypto/signature/rsa/verifyRsa65537Pkcs1v1_5.circom b/circuits/circuits/utils/crypto/signature/rsa/verifyRsa65537Pkcs1v1_5.circom index e05b9148..9dd50514 100644 --- a/circuits/circuits/utils/crypto/signature/rsa/verifyRsa65537Pkcs1v1_5.circom +++ b/circuits/circuits/utils/crypto/signature/rsa/verifyRsa65537Pkcs1v1_5.circom @@ -1,6 +1,6 @@ pragma circom 2.1.9; -include "@zk-email/circuits/lib/bigint.circom"; +include "@openpassport/zk-email-circuits/lib/bigint.circom"; include "./pkcs1v1_5Padding.circom"; include "../FpPowMod.circom"; diff --git a/circuits/circuits/utils/passport/computeCommitment.circom b/circuits/circuits/utils/passport/computeCommitment.circom index 7a60356d..a75ac324 100644 --- a/circuits/circuits/utils/passport/computeCommitment.circom +++ b/circuits/circuits/utils/passport/computeCommitment.circom @@ -1,7 +1,7 @@ pragma circom 2.1.9; include "circomlib/circuits/poseidon.circom"; -include "@zk-email/circuits/utils/bytes.circom"; +include "@openpassport/zk-email-circuits/utils/bytes.circom"; include "./customHashers.circom"; template ComputeCommitment() { diff --git a/circuits/circuits/utils/passport/customHashers.circom b/circuits/circuits/utils/passport/customHashers.circom index 6a47b1bb..0b17be56 100644 --- a/circuits/circuits/utils/passport/customHashers.circom +++ b/circuits/circuits/utils/passport/customHashers.circom @@ -4,7 +4,7 @@ include "circomlib/circuits/poseidon.circom"; template CustomHasher(k) { signal input in[k]; - var rounds = div_ceil_dl(k, 16); + var rounds = div_ceil(k, 16); assert(rounds < 17); component hash[rounds]; diff --git a/circuits/circuits/utils/passport/disclose/disclose.circom b/circuits/circuits/utils/passport/disclose/disclose.circom index 346e5b16..4ac61f2e 100644 --- a/circuits/circuits/utils/passport/disclose/disclose.circom +++ b/circuits/circuits/utils/passport/disclose/disclose.circom @@ -1,6 +1,6 @@ pragma circom 2.1.9; -include "@zk-email/circuits/utils/bytes.circom"; +include "@openpassport/zk-email-circuits/utils/bytes.circom"; include "../date/isOlderThan.circom"; template DISCLOSE() { diff --git a/circuits/circuits/utils/passport/disclose/proveCountryIsNotInList.circom b/circuits/circuits/utils/passport/disclose/proveCountryIsNotInList.circom index 2bb7968b..ef9f2633 100644 --- a/circuits/circuits/utils/passport/disclose/proveCountryIsNotInList.circom +++ b/circuits/circuits/utils/passport/disclose/proveCountryIsNotInList.circom @@ -1,7 +1,7 @@ pragma circom 2.1.5; include "circomlib/circuits/comparators.circom"; -include "@zk-email/circuits/utils/bytes.circom"; +include "@openpassport/zk-email-circuits/utils/bytes.circom"; template ProveCountryIsNotInList(forbiddenCountriesListLength) { signal input dg1[93]; diff --git a/circuits/circuits/utils/passport/disclose/verify_commitment.circom b/circuits/circuits/utils/passport/disclose/verify_commitment.circom index b9472d7b..170e8ea1 100644 --- a/circuits/circuits/utils/passport/disclose/verify_commitment.circom +++ b/circuits/circuits/utils/passport/disclose/verify_commitment.circom @@ -1,6 +1,6 @@ pragma circom 2.1.9; -include "@zk-email/circuits/utils/bytes.circom"; +include "@openpassport/zk-email-circuits/utils/bytes.circom"; include "@zk-kit/binary-merkle-root.circom/src/binary-merkle-root.circom"; include "../computeCommitment.circom"; diff --git a/circuits/circuits/utils/passport/passportVerifier.circom b/circuits/circuits/utils/passport/passportVerifier.circom index b37877a9..fa5c8740 100644 --- a/circuits/circuits/utils/passport/passportVerifier.circom +++ b/circuits/circuits/utils/passport/passportVerifier.circom @@ -1,7 +1,7 @@ pragma circom 2.1.9; -include "@zk-email/circuits/utils/array.circom"; -include "@zk-email/circuits/utils/bytes.circom"; +include "@openpassport/zk-email-circuits/utils/array.circom"; +include "@openpassport/zk-email-circuits/utils/bytes.circom"; include "../crypto/hasher/shaBytes/shaBytesDynamic.circom"; include "../crypto/hasher/hash.circom"; include "./signatureAlgorithm.circom"; diff --git a/circuits/circuits/utils/passport/signatureVerifier.circom b/circuits/circuits/utils/passport/signatureVerifier.circom index 4aeec8ec..2dd23627 100644 --- a/circuits/circuits/utils/passport/signatureVerifier.circom +++ b/circuits/circuits/utils/passport/signatureVerifier.circom @@ -5,7 +5,7 @@ include "../crypto/signature/rsapss/rsapss65537.circom"; include "../crypto/signature/ecdsa/ecdsaVerifier.circom"; include "../crypto/signature/rsa/verifyRsa3Pkcs1v1_5.circom"; include "../crypto/signature/rsa/verifyRsa65537Pkcs1v1_5.circom"; -include "@zk-email/circuits/utils/bytes.circom"; +include "@openpassport/zk-email-circuits/utils/bytes.circom"; template SignatureVerifier(signatureAlgorithm, n, k) { var kLengthFactor = getKLengthFactor(signatureAlgorithm); diff --git a/circuits/package.json b/circuits/package.json index fcf368c4..d6a5fbad 100644 --- a/circuits/package.json +++ b/circuits/package.json @@ -17,6 +17,7 @@ }, "dependencies": { "@noble/curves": "^1.4.2", + "@openpassport/zk-email-circuits": "^6.1.2", "@openpassport/zk-kit-imt": "^0.0.4", "@openpassport/zk-kit-lean-imt": "^0.0.4", "@openpassport/zk-kit-smt": "^0.0.1", @@ -32,6 +33,7 @@ "asn1.js": "^5.4.1", "asn1js": "^3.0.5", "chai-as-promised": "^7.1.1", + "circom-bigint": "https://github.com/0xbok/circom-bigint", "circom-dl": "https://github.com/distributed-lab/circom-dl", "circom_tester": "github:remicolin/circom_tester#main", "circomlib": "^2.0.5", diff --git a/circuits/yarn.lock b/circuits/yarn.lock index 2d66d51e..0061f4f1 100644 --- a/circuits/yarn.lock +++ b/circuits/yarn.lock @@ -564,6 +564,16 @@ __metadata: languageName: node linkType: hard +"@openpassport/zk-email-circuits@npm:^6.1.2": + version: 6.1.2 + resolution: "@openpassport/zk-email-circuits@npm:6.1.2" + dependencies: + "@zk-email/zk-regex-circom": "npm:^2.1.0" + circomlib: "npm:^2.0.5" + checksum: 10c0/cc26f12f320643172a614b7a5e53ead6d412cb70be3c256fdd6dcdd1a58ef755c612407a28cfb7f9ee1b41f06e9bee4d8bf4e996b38c845f6a2a3468277da36c + languageName: node + linkType: hard + "@openpassport/zk-kit-imt@npm:^0.0.4": version: 0.0.4 resolution: "@openpassport/zk-kit-imt@npm:0.0.4" @@ -926,7 +936,7 @@ __metadata: languageName: node linkType: hard -"@zk-email/zk-regex-circom@npm:^2.3.1": +"@zk-email/zk-regex-circom@npm:^2.1.0, @zk-email/zk-regex-circom@npm:^2.3.1": version: 2.3.2 resolution: "@zk-email/zk-regex-circom@npm:2.3.2" dependencies: @@ -1189,6 +1199,13 @@ __metadata: languageName: node linkType: hard +"big-integer@npm:^1.6.42, big-integer@npm:^1.6.48": + version: 1.6.52 + resolution: "big-integer@npm:1.6.52" + checksum: 10c0/9604224b4c2ab3c43c075d92da15863077a9f59e5d4205f4e7e76acd0cd47e8d469ec5e5dba8d9b32aa233951893b29329ca56ac80c20ce094b4a647a66abae0 + languageName: node + linkType: hard + "binary-extensions@npm:^2.0.0": version: 2.3.0 resolution: "binary-extensions@npm:2.3.0" @@ -1228,6 +1245,13 @@ __metadata: languageName: node linkType: hard +"blakejs@npm:^1.1.0": + version: 1.2.1 + resolution: "blakejs@npm:1.2.1" + checksum: 10c0/c284557ce55b9c70203f59d381f1b85372ef08ee616a90162174d1291a45d3e5e809fdf9edab6e998740012538515152471dc4f1f9dbfa974ba2b9c1f7b9aad7 + languageName: node + linkType: hard + "bluebird@npm:^3.7.2": version: 3.7.2 resolution: "bluebird@npm:3.7.2" @@ -1533,6 +1557,17 @@ __metadata: languageName: node linkType: hard +"circom-bigint@https://github.com/0xbok/circom-bigint": + version: 0.0.1 + resolution: "circom-bigint@https://github.com/0xbok/circom-bigint.git#commit=4f78084327e993136edb2a8f4bd52ffbb437ab78" + dependencies: + circomlib: "npm:^2.0.2" + ethers: "npm:^5.5.2" + snarkjs: "npm:^0.4.10" + checksum: 10c0/f8d28c131cb341ec279ced8eed63500cbe0fd30292925e954a20c1f968c1287c8e4d327fdb223d24d69ceb30acb3de676cad3574da9b2fc2764dbcc976ca7d1c + languageName: node + linkType: hard + "circom-dl@https://github.com/distributed-lab/circom-dl": version: 1.0.0 resolution: "circom-dl@https://github.com/distributed-lab/circom-dl.git#commit=9af9efb66bb801e77030596624cffb5fa3383eb9" @@ -1552,6 +1587,7 @@ __metadata: resolution: "circom-passport@workspace:." dependencies: "@noble/curves": "npm:^1.4.2" + "@openpassport/zk-email-circuits": "npm:^6.1.2" "@openpassport/zk-kit-imt": "npm:^0.0.4" "@openpassport/zk-kit-lean-imt": "npm:^0.0.4" "@openpassport/zk-kit-smt": "npm:^0.0.1" @@ -1572,6 +1608,7 @@ __metadata: asn1js: "npm:^3.0.5" chai: "npm:4.3.8" chai-as-promised: "npm:^7.1.1" + circom-bigint: "https://github.com/0xbok/circom-bigint" circom-dl: "https://github.com/distributed-lab/circom-dl" circom_tester: "github:remicolin/circom_tester#main" circomlib: "npm:^2.0.5" @@ -1593,6 +1630,17 @@ __metadata: languageName: unknown linkType: soft +"circom_runtime@npm:0.1.20": + version: 0.1.20 + resolution: "circom_runtime@npm:0.1.20" + dependencies: + ffjavascript: "npm:0.2.55" + bin: + calcwit: calcwit.js + checksum: 10c0/fc09e9dc7673e94ff9582f049b8e2c84c3fc64844e4b1287ca255e9ca9d71be706c21059f6b0bbdc06769416aa7bc889e52c5ca60b084b8624a7e4ce3adac348 + languageName: node + linkType: hard + "circom_runtime@npm:0.1.21": version: 0.1.21 resolution: "circom_runtime@npm:0.1.21" @@ -1645,7 +1693,7 @@ __metadata: languageName: node linkType: hard -"circomlib@npm:^2.0.5": +"circomlib@npm:^2.0.2, circomlib@npm:^2.0.5": version: 2.0.5 resolution: "circomlib@npm:2.0.5" checksum: 10c0/6709e3df9e16c09015e69f9ee01d5fde340b888743a204be27e37880337db61f013f4a6b9573935fb410ddb02a0e89367edf509b89182a0c2e07c8a4777c91a4 @@ -2068,7 +2116,7 @@ __metadata: languageName: node linkType: hard -"ethers@npm:^5.5.1": +"ethers@npm:^5.5.1, ethers@npm:^5.5.2": version: 5.7.2 resolution: "ethers@npm:5.7.2" dependencies: @@ -2149,6 +2197,18 @@ __metadata: languageName: node linkType: hard +"ffjavascript@npm:0.2.55": + version: 0.2.55 + resolution: "ffjavascript@npm:0.2.55" + dependencies: + big-integer: "npm:^1.6.48" + wasmbuilder: "npm:^0.0.12" + wasmcurves: "npm:0.1.0" + web-worker: "npm:^1.2.0" + checksum: 10c0/84e5b0d6acc5b7505cd46ba7bffba0f614d564f3c0296650f5e5769b601ff52e24bd7b3c0135e767a46b0db8973887a349c863f080d0affce10b0a9a768133f7 + languageName: node + linkType: hard + "ffjavascript@npm:0.2.56": version: 0.2.56 resolution: "ffjavascript@npm:0.2.56" @@ -3615,6 +3675,18 @@ __metadata: languageName: node linkType: hard +"r1csfile@npm:0.0.40": + version: 0.0.40 + resolution: "r1csfile@npm:0.0.40" + dependencies: + "@iden3/bigarray": "npm:0.0.2" + "@iden3/binfileutils": "npm:0.0.11" + fastfile: "npm:0.0.20" + ffjavascript: "npm:0.2.55" + checksum: 10c0/55bb953ab875f97d3dc2941ee97459058ccc4be87bbff02ca3084d039d20e8cd78c91c45afb71877156c3201870359171f1bea78557d1a3efea8c899e3cc364a + languageName: node + linkType: hard + "r1csfile@npm:0.0.41": version: 0.0.41 resolution: "r1csfile@npm:0.0.41" @@ -3859,6 +3931,26 @@ __metadata: languageName: node linkType: hard +"snarkjs@npm:^0.4.10": + version: 0.4.27 + resolution: "snarkjs@npm:0.4.27" + dependencies: + "@iden3/binfileutils": "npm:0.0.11" + bfj: "npm:^7.0.2" + blake2b-wasm: "npm:^2.4.0" + circom_runtime: "npm:0.1.20" + ejs: "npm:^3.1.6" + fastfile: "npm:0.0.20" + ffjavascript: "npm:0.2.55" + js-sha3: "npm:^0.8.0" + logplease: "npm:^1.2.15" + r1csfile: "npm:0.0.40" + bin: + snarkjs: build/cli.cjs + checksum: 10c0/fb764e9a4eef6d1d5e3d8f623d0f92aa965d840a28bcd18f4201cbeeeb8f430da629507b7506c78da0fa3ea4646cfeec5b852c1757f4e71bd96bdde4bc7a8c1c + languageName: node + linkType: hard + "snarkjs@npm:^0.7.0, snarkjs@npm:^0.7.1, snarkjs@npm:^0.7.5": version: 0.7.5 resolution: "snarkjs@npm:0.7.5" @@ -4328,6 +4420,25 @@ __metadata: languageName: node linkType: hard +"wasmbuilder@npm:^0.0.12": + version: 0.0.12 + resolution: "wasmbuilder@npm:0.0.12" + dependencies: + big-integer: "npm:^1.6.48" + checksum: 10c0/7b3421a0cc58666ab690833ea6a24be4440ff7861da03812bc82d8498d8ddefde319ee710be3c42c35bfdd8e64568a41b59a28d7865f16b73a4186e0d13cef39 + languageName: node + linkType: hard + +"wasmcurves@npm:0.1.0": + version: 0.1.0 + resolution: "wasmcurves@npm:0.1.0" + dependencies: + big-integer: "npm:^1.6.42" + blakejs: "npm:^1.1.0" + checksum: 10c0/6ace0476b95e9911be9b588dd04593f977144cf9aa4e74f0d50b95e37dce2c968ac8b433c353b973cfe6436c720c6e4a21cdb2ceb8a8435210ab68d55ea3911d + languageName: node + linkType: hard + "wasmcurves@npm:0.2.0": version: 0.2.0 resolution: "wasmcurves@npm:0.2.0"