@zkpassport/sdk 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/constants.cjs +10 -4
- package/dist/cjs/constants.d.cts +5 -3
- package/dist/cjs/index.cjs +731 -725
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/public-input-checker.cjs +61 -54
- package/dist/cjs/solidity-verifier.cjs +669 -670
- package/dist/cjs/types.d.cts +11 -2
- package/dist/esm/{chunk-BUYJZSHP.js → chunk-OOHOBXGU.js} +62 -55
- package/dist/esm/chunk-OTQ7QDA2.js +2541 -0
- package/dist/esm/chunk-VJZDMGW3.js +18 -0
- package/dist/esm/constants.d.ts +5 -3
- package/dist/esm/constants.js +7 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/public-input-checker.js +2 -2
- package/dist/esm/solidity-verifier.js +2 -2
- package/dist/esm/types.d.ts +11 -2
- package/package.json +1 -1
- package/dist/esm/chunk-JITNXEQS.js +0 -2542
- package/dist/esm/chunk-XOQW7AOQ.js +0 -14
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueryBuilder, QueryResultErrors, SolidityVerifierParameters } from './types.cjs';
|
|
2
|
-
export { QueryBuilderResult, QueryResultError } from './types.cjs';
|
|
2
|
+
export { QueryBuilderResult, QueryResultError, SolidityCommitments, SolidityProofVerificationData, SolidityServiceConfig } from './types.cjs';
|
|
3
3
|
import { ProofMode, ProofResult, QueryResult, NullifierType, SupportedChain } from '@zkpassport/utils';
|
|
4
4
|
export * from '@zkpassport/utils';
|
|
5
5
|
export { ASEAN_COUNTRIES, EEA_COUNTRIES, EU_COUNTRIES, MERCOSUR_COUNTRIES, SANCTIONED_COUNTRIES, SCHENGEN_COUNTRIES } from '@zkpassport/utils';
|
|
@@ -29,22 +29,19 @@ var import_registry = require("@zkpassport/registry");
|
|
|
29
29
|
// src/constants.ts
|
|
30
30
|
var DEFAULT_VALIDITY = 7 * 24 * 60 * 60;
|
|
31
31
|
var DEFAULT_DATE_VALUE = /* @__PURE__ */ new Date(0);
|
|
32
|
-
var
|
|
32
|
+
var ZKPASSPORT_IOS_APP_ID_HASH = "0x1fa73686cf510f8f85757b0602de0dd72a13e68ae2092462be8b72662e7f179b";
|
|
33
|
+
var ZKPASSPORT_ANDROID_APP_ID_HASH = "0x24d9929b248be7eeecaa98e105c034a50539610f3fdd4cb9c8983ef4100d615d";
|
|
33
34
|
var APPLE_APP_ATTEST_ROOT_KEY_HASH = "0x2532418a107c5306fa8308c22255792cf77e4a290cbce8a840a642a3e591340b";
|
|
35
|
+
var GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH = "0x16700a2d9168a194fc85f237af5829b5a2be05b8ae8ac4879ada34cf54a9c211";
|
|
34
36
|
|
|
35
37
|
// src/public-input-checker.ts
|
|
36
38
|
var PublicInputChecker = class {
|
|
37
39
|
static checkDiscloseBytesPublicInputs(proof, queryResult) {
|
|
38
40
|
const queryResultErrors = {};
|
|
39
41
|
let isCorrect = true;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
44
|
-
const disclosedDataIDCard = import_utils.DisclosedData.fromDisclosedBytes(
|
|
45
|
-
(proof.committedInputs?.disclose_bytes).disclosedBytes,
|
|
46
|
-
"id_card"
|
|
47
|
-
);
|
|
42
|
+
const disclosedBytes = (proof.committedInputs?.disclose_bytes).disclosedBytes ?? (proof.committedInputs?.disclose_bytes_evm).disclosedBytes;
|
|
43
|
+
const disclosedDataPassport = import_utils.DisclosedData.fromDisclosedBytes(disclosedBytes, "passport");
|
|
44
|
+
const disclosedDataIDCard = import_utils.DisclosedData.fromDisclosedBytes(disclosedBytes, "id_card");
|
|
48
45
|
if (queryResult.document_type) {
|
|
49
46
|
if (queryResult.document_type.eq && queryResult.document_type.eq.result && queryResult.document_type.eq.expected !== disclosedDataPassport.documentType) {
|
|
50
47
|
console.warn("Document type does not match the expected document type");
|
|
@@ -339,10 +336,10 @@ var PublicInputChecker = class {
|
|
|
339
336
|
0
|
|
340
337
|
);
|
|
341
338
|
const minAge = (0, import_utils.getMinAgeFromCommittedInputs)(
|
|
342
|
-
proof.committedInputs?.compare_age
|
|
339
|
+
proof.committedInputs?.compare_age ?? proof.committedInputs?.compare_age_evm
|
|
343
340
|
);
|
|
344
341
|
const maxAge = (0, import_utils.getMaxAgeFromCommittedInputs)(
|
|
345
|
-
proof.committedInputs?.compare_age
|
|
342
|
+
proof.committedInputs?.compare_age ?? proof.committedInputs?.compare_age_evm
|
|
346
343
|
);
|
|
347
344
|
if (queryResult.age) {
|
|
348
345
|
if (queryResult.age.gte && queryResult.age.gte.result && minAge !== queryResult.age.gte.expected) {
|
|
@@ -430,7 +427,7 @@ var PublicInputChecker = class {
|
|
|
430
427
|
};
|
|
431
428
|
}
|
|
432
429
|
const currentDate = (0, import_utils.getCurrentDateFromCommittedInputs)(
|
|
433
|
-
proof.committedInputs?.compare_age
|
|
430
|
+
proof.committedInputs?.compare_age ?? proof.committedInputs?.compare_age_evm
|
|
434
431
|
);
|
|
435
432
|
if (!(0, import_utils.areDatesEqual)(currentDate, today) && !(0, import_utils.areDatesEqual)(currentDate, today.getTime() - 864e5)) {
|
|
436
433
|
console.warn("Current date in the proof is too old");
|
|
@@ -459,15 +456,15 @@ var PublicInputChecker = class {
|
|
|
459
456
|
0
|
|
460
457
|
);
|
|
461
458
|
const minDate = (0, import_utils.getBirthdateMinDateTimestamp)(
|
|
462
|
-
proof.committedInputs?.compare_birthdate,
|
|
459
|
+
proof.committedInputs?.compare_birthdate ?? proof.committedInputs?.compare_birthdate_evm,
|
|
463
460
|
-1 * import_utils.SECONDS_BETWEEN_1900_AND_1970
|
|
464
461
|
);
|
|
465
462
|
const maxDate = (0, import_utils.getBirthdateMaxDateTimestamp)(
|
|
466
|
-
proof.committedInputs?.compare_birthdate,
|
|
463
|
+
proof.committedInputs?.compare_birthdate ?? proof.committedInputs?.compare_birthdate_evm,
|
|
467
464
|
-1 * import_utils.SECONDS_BETWEEN_1900_AND_1970
|
|
468
465
|
);
|
|
469
466
|
const currentDate = (0, import_utils.getCurrentDateFromCommittedInputs)(
|
|
470
|
-
proof.committedInputs?.compare_birthdate
|
|
467
|
+
proof.committedInputs?.compare_birthdate ?? proof.committedInputs?.compare_birthdate_evm
|
|
471
468
|
);
|
|
472
469
|
if (queryResult.birthdate) {
|
|
473
470
|
if (queryResult.birthdate.gte && queryResult.birthdate.gte.result && !(0, import_utils.areDatesEqual)(minDate, queryResult.birthdate.gte.expected)) {
|
|
@@ -569,13 +566,13 @@ var PublicInputChecker = class {
|
|
|
569
566
|
0
|
|
570
567
|
);
|
|
571
568
|
const minDate = (0, import_utils.getMinDateFromCommittedInputs)(
|
|
572
|
-
proof.committedInputs?.compare_expiry
|
|
569
|
+
proof.committedInputs?.compare_expiry ?? proof.committedInputs?.compare_expiry_evm
|
|
573
570
|
);
|
|
574
571
|
const maxDate = (0, import_utils.getMaxDateFromCommittedInputs)(
|
|
575
|
-
proof.committedInputs?.compare_expiry
|
|
572
|
+
proof.committedInputs?.compare_expiry ?? proof.committedInputs?.compare_expiry_evm
|
|
576
573
|
);
|
|
577
574
|
const currentDate = (0, import_utils.getCurrentDateFromCommittedInputs)(
|
|
578
|
-
proof.committedInputs?.compare_expiry
|
|
575
|
+
proof.committedInputs?.compare_expiry ?? proof.committedInputs?.compare_expiry_evm
|
|
579
576
|
);
|
|
580
577
|
if (queryResult.expiry_date) {
|
|
581
578
|
if (queryResult.expiry_date.gte && queryResult.expiry_date.gte.result && !(0, import_utils.areDatesEqual)(minDate, queryResult.expiry_date.gte.expected)) {
|
|
@@ -957,19 +954,25 @@ var PublicInputChecker = class {
|
|
|
957
954
|
let isCorrect = true;
|
|
958
955
|
let queryResultErrors = {};
|
|
959
956
|
if (queryResult.facematch && queryResult.facematch.passed) {
|
|
960
|
-
if (facematchCommittedInputs.rootKeyLeaf !== APPLE_APP_ATTEST_ROOT_KEY_HASH) {
|
|
957
|
+
if (facematchCommittedInputs.rootKeyLeaf !== APPLE_APP_ATTEST_ROOT_KEY_HASH && facematchCommittedInputs.rootKeyLeaf !== GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH) {
|
|
961
958
|
console.warn("Invalid facematch root key hash");
|
|
962
959
|
isCorrect = false;
|
|
963
960
|
queryResultErrors.facematch = {
|
|
964
961
|
...queryResultErrors.facematch,
|
|
965
962
|
eq: {
|
|
966
|
-
expected: APPLE_APP_ATTEST_ROOT_KEY_HASH
|
|
963
|
+
expected: `${APPLE_APP_ATTEST_ROOT_KEY_HASH} (iOS) or ${GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH} (Android)`,
|
|
967
964
|
received: facematchCommittedInputs.rootKeyLeaf,
|
|
968
965
|
message: "Invalid facematch root key hash"
|
|
969
966
|
}
|
|
970
967
|
};
|
|
971
968
|
}
|
|
972
969
|
const EXPECTED_ENVIRONMENT = "production";
|
|
970
|
+
console.log("facematchCommittedInputs.environment", facematchCommittedInputs.environment);
|
|
971
|
+
console.log("EXPECTED_ENVIRONMENT", EXPECTED_ENVIRONMENT);
|
|
972
|
+
console.log(
|
|
973
|
+
"facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT",
|
|
974
|
+
facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT
|
|
975
|
+
);
|
|
973
976
|
if (facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT) {
|
|
974
977
|
console.warn("Invalid facematch environment, it should be production");
|
|
975
978
|
isCorrect = false;
|
|
@@ -982,7 +985,7 @@ var PublicInputChecker = class {
|
|
|
982
985
|
}
|
|
983
986
|
};
|
|
984
987
|
}
|
|
985
|
-
if (facematchCommittedInputs.appId !==
|
|
988
|
+
if (facematchCommittedInputs.appId !== ZKPASSPORT_IOS_APP_ID_HASH && facematchCommittedInputs.appId !== ZKPASSPORT_ANDROID_APP_ID_HASH) {
|
|
986
989
|
console.warn(
|
|
987
990
|
"Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
|
|
988
991
|
);
|
|
@@ -990,7 +993,7 @@ var PublicInputChecker = class {
|
|
|
990
993
|
queryResultErrors.facematch = {
|
|
991
994
|
...queryResultErrors.facematch,
|
|
992
995
|
eq: {
|
|
993
|
-
expected:
|
|
996
|
+
expected: `${ZKPASSPORT_IOS_APP_ID_HASH} (iOS) or ${ZKPASSPORT_ANDROID_APP_ID_HASH} (Android)`,
|
|
994
997
|
received: facematchCommittedInputs.appId,
|
|
995
998
|
message: "Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
|
|
996
999
|
}
|
|
@@ -1124,8 +1127,8 @@ var PublicInputChecker = class {
|
|
|
1124
1127
|
}
|
|
1125
1128
|
};
|
|
1126
1129
|
}
|
|
1127
|
-
if (!!committedInputs?.compare_age) {
|
|
1128
|
-
const ageCommittedInputs = committedInputs?.compare_age;
|
|
1130
|
+
if (!!committedInputs?.compare_age || !!committedInputs?.compare_age_evm) {
|
|
1131
|
+
const ageCommittedInputs = committedInputs?.compare_age ?? committedInputs?.compare_age_evm;
|
|
1129
1132
|
const ageParameterCommitment = isForEVM ? await (0, import_utils.getAgeEVMParameterCommitment)(
|
|
1130
1133
|
ageCommittedInputs.currentDateTimestamp,
|
|
1131
1134
|
ageCommittedInputs.minAge,
|
|
@@ -1153,8 +1156,9 @@ var PublicInputChecker = class {
|
|
|
1153
1156
|
...queryResultErrors,
|
|
1154
1157
|
...queryResultErrorsAge
|
|
1155
1158
|
};
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1159
|
+
}
|
|
1160
|
+
if (!!committedInputs?.compare_birthdate || !!committedInputs?.compare_birthdate_evm) {
|
|
1161
|
+
const birthdateCommittedInputs = committedInputs?.compare_birthdate ?? committedInputs?.compare_birthdate_evm;
|
|
1158
1162
|
const birthdateParameterCommitment = isForEVM ? await (0, import_utils.getDateEVMParameterCommitment)(
|
|
1159
1163
|
import_utils.ProofType.BIRTHDATE,
|
|
1160
1164
|
birthdateCommittedInputs.currentDateTimestamp,
|
|
@@ -1186,8 +1190,9 @@ var PublicInputChecker = class {
|
|
|
1186
1190
|
...queryResultErrors,
|
|
1187
1191
|
...queryResultErrorsBirthdate
|
|
1188
1192
|
};
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1193
|
+
}
|
|
1194
|
+
if (!!committedInputs?.compare_expiry || !!committedInputs?.compare_expiry_evm) {
|
|
1195
|
+
const expiryCommittedInputs = committedInputs?.compare_expiry ?? committedInputs?.compare_expiry_evm;
|
|
1191
1196
|
const expiryParameterCommitment = isForEVM ? await (0, import_utils.getDateEVMParameterCommitment)(
|
|
1192
1197
|
import_utils.ProofType.EXPIRY_DATE,
|
|
1193
1198
|
expiryCommittedInputs.currentDateTimestamp,
|
|
@@ -1217,8 +1222,9 @@ var PublicInputChecker = class {
|
|
|
1217
1222
|
...queryResultErrors,
|
|
1218
1223
|
...queryResultErrorsExpiryDate
|
|
1219
1224
|
};
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1225
|
+
}
|
|
1226
|
+
if (!!committedInputs?.disclose_bytes || !!committedInputs?.disclose_bytes_evm) {
|
|
1227
|
+
const discloseCommittedInputs = committedInputs?.disclose_bytes ?? committedInputs?.disclose_bytes_evm;
|
|
1222
1228
|
const discloseParameterCommitment = isForEVM ? await (0, import_utils.getDiscloseEVMParameterCommitment)(
|
|
1223
1229
|
discloseCommittedInputs.discloseMask,
|
|
1224
1230
|
discloseCommittedInputs.disclosedBytes
|
|
@@ -1244,8 +1250,9 @@ var PublicInputChecker = class {
|
|
|
1244
1250
|
...queryResultErrors,
|
|
1245
1251
|
...queryResultErrorsDisclose
|
|
1246
1252
|
};
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1253
|
+
}
|
|
1254
|
+
if (!!committedInputs?.inclusion_check_nationality || !!committedInputs?.inclusion_check_nationality_evm) {
|
|
1255
|
+
const inclusionCheckNationalityCommittedInputs = committedInputs?.inclusion_check_nationality ?? committedInputs?.inclusion_check_nationality_evm;
|
|
1249
1256
|
const inclusionCheckNationalityParameterCommitment = isForEVM ? await (0, import_utils.getCountryEVMParameterCommitment)(
|
|
1250
1257
|
import_utils.ProofType.NATIONALITY_INCLUSION,
|
|
1251
1258
|
inclusionCheckNationalityCommittedInputs.countries
|
|
@@ -1275,8 +1282,9 @@ var PublicInputChecker = class {
|
|
|
1275
1282
|
...queryResultErrors,
|
|
1276
1283
|
...queryResultErrorsNationalityInclusion
|
|
1277
1284
|
};
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1285
|
+
}
|
|
1286
|
+
if (!!committedInputs?.inclusion_check_issuing_country || !!committedInputs?.inclusion_check_issuing_country_evm) {
|
|
1287
|
+
const inclusionCheckIssuingCountryCommittedInputs = committedInputs?.inclusion_check_issuing_country ?? committedInputs?.inclusion_check_issuing_country_evm;
|
|
1280
1288
|
const inclusionCheckIssuingCountryParameterCommitment = isForEVM ? await (0, import_utils.getCountryEVMParameterCommitment)(
|
|
1281
1289
|
import_utils.ProofType.ISSUING_COUNTRY_INCLUSION,
|
|
1282
1290
|
inclusionCheckIssuingCountryCommittedInputs.countries
|
|
@@ -1306,8 +1314,9 @@ var PublicInputChecker = class {
|
|
|
1306
1314
|
...queryResultErrors,
|
|
1307
1315
|
...queryResultErrorsIssuingCountryInclusion
|
|
1308
1316
|
};
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1317
|
+
}
|
|
1318
|
+
if (!!committedInputs?.exclusion_check_nationality || !!committedInputs?.exclusion_check_nationality_evm) {
|
|
1319
|
+
const exclusionCheckNationalityCommittedInputs = committedInputs?.exclusion_check_nationality ?? committedInputs?.exclusion_check_nationality_evm;
|
|
1311
1320
|
const exclusionCheckNationalityParameterCommitment = isForEVM ? await (0, import_utils.getCountryEVMParameterCommitment)(
|
|
1312
1321
|
import_utils.ProofType.NATIONALITY_EXCLUSION,
|
|
1313
1322
|
exclusionCheckNationalityCommittedInputs.countries
|
|
@@ -1337,8 +1346,9 @@ var PublicInputChecker = class {
|
|
|
1337
1346
|
...queryResultErrors,
|
|
1338
1347
|
...queryResultErrorsNationalityExclusion
|
|
1339
1348
|
};
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1349
|
+
}
|
|
1350
|
+
if (!!committedInputs?.exclusion_check_issuing_country || !!committedInputs?.exclusion_check_issuing_country_evm) {
|
|
1351
|
+
const exclusionCheckIssuingCountryCommittedInputs = committedInputs?.exclusion_check_issuing_country ?? committedInputs?.exclusion_check_issuing_country_evm;
|
|
1342
1352
|
const exclusionCheckIssuingCountryParameterCommitment = isForEVM ? await (0, import_utils.getCountryEVMParameterCommitment)(
|
|
1343
1353
|
import_utils.ProofType.ISSUING_COUNTRY_EXCLUSION,
|
|
1344
1354
|
exclusionCheckIssuingCountryCommittedInputs.countries
|
|
@@ -1368,8 +1378,9 @@ var PublicInputChecker = class {
|
|
|
1368
1378
|
...queryResultErrors,
|
|
1369
1379
|
...queryResultErrorsIssuingCountryExclusion
|
|
1370
1380
|
};
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1381
|
+
}
|
|
1382
|
+
if (!!committedInputs?.bind || !!committedInputs?.bind_evm) {
|
|
1383
|
+
const bindCommittedInputs = committedInputs?.bind ?? committedInputs?.bind_evm;
|
|
1373
1384
|
const bindParameterCommitment = isForEVM ? await (0, import_utils.getBindEVMParameterCommitment)((0, import_utils.formatBoundData)(bindCommittedInputs.data)) : await (0, import_utils.getBindParameterCommitment)((0, import_utils.formatBoundData)(bindCommittedInputs.data));
|
|
1374
1385
|
if (!paramCommitments.includes(bindParameterCommitment)) {
|
|
1375
1386
|
console.warn("This proof does not verify the bound data");
|
|
@@ -1389,9 +1400,10 @@ var PublicInputChecker = class {
|
|
|
1389
1400
|
...queryResultErrors,
|
|
1390
1401
|
...queryResultErrorsBind
|
|
1391
1402
|
};
|
|
1392
|
-
}
|
|
1403
|
+
}
|
|
1404
|
+
if (!!committedInputs?.exclusion_check_sanctions || !!committedInputs?.exclusion_check_sanctions_evm) {
|
|
1393
1405
|
const sanctionsBuilder = await import_utils.SanctionsBuilder.create();
|
|
1394
|
-
const exclusionCheckSanctionsCommittedInputs = committedInputs?.exclusion_check_sanctions;
|
|
1406
|
+
const exclusionCheckSanctionsCommittedInputs = committedInputs?.exclusion_check_sanctions ?? committedInputs?.exclusion_check_sanctions_evm;
|
|
1395
1407
|
const exclusionCheckSanctionsParameterCommitment = isForEVM ? await sanctionsBuilder.getSanctionsEvmParameterCommitment() : await sanctionsBuilder.getSanctionsParameterCommitment();
|
|
1396
1408
|
if (!paramCommitments.includes(exclusionCheckSanctionsParameterCommitment)) {
|
|
1397
1409
|
console.warn("This proof does not verify the exclusion from the sanction lists");
|
|
@@ -1418,22 +1430,19 @@ var PublicInputChecker = class {
|
|
|
1418
1430
|
...queryResultErrors,
|
|
1419
1431
|
...queryResultErrorsSanctionsExclusion
|
|
1420
1432
|
};
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1433
|
+
}
|
|
1434
|
+
if (!!committedInputs?.facematch || !!committedInputs?.facematch_evm) {
|
|
1435
|
+
const facematchCommittedInputs = committedInputs?.facematch ?? committedInputs?.facematch_evm;
|
|
1423
1436
|
const facematchParameterCommitment = isForEVM ? await (0, import_utils.getFacematchEvmParameterCommitment)(
|
|
1424
1437
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
1425
1438
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
1426
1439
|
BigInt(facematchCommittedInputs.appId),
|
|
1427
|
-
|
|
1428
|
-
// facematchCommittedInputs.mode === "regular" ? 1n : 2n,
|
|
1429
|
-
1n
|
|
1440
|
+
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
1430
1441
|
) : await (0, import_utils.getFacematchParameterCommitment)(
|
|
1431
1442
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
1432
1443
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
1433
1444
|
BigInt(facematchCommittedInputs.appId),
|
|
1434
|
-
|
|
1435
|
-
// facematchCommittedInputs.mode === "regular" ? 1n : 2n,
|
|
1436
|
-
1n
|
|
1445
|
+
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
1437
1446
|
);
|
|
1438
1447
|
if (!paramCommitments.includes(facematchParameterCommitment)) {
|
|
1439
1448
|
console.warn("This proof does not verify FaceMatch");
|
|
@@ -2016,16 +2025,14 @@ var PublicInputChecker = class {
|
|
|
2016
2025
|
};
|
|
2017
2026
|
uniqueIdentifier = (0, import_utils.getNullifierFromDisclosureProof)(proofData).toString(10);
|
|
2018
2027
|
uniqueIdentifierType = (0, import_utils.getNullifierTypeFromDisclosureProof)(proofData);
|
|
2019
|
-
} else if (proof.name
|
|
2028
|
+
} else if (proof.name?.startsWith("facematch") && !proof.name?.endsWith("_evm")) {
|
|
2020
2029
|
const facematchCommittedInputs = proof.committedInputs?.facematch;
|
|
2021
2030
|
const paramCommittment = (0, import_utils.getParameterCommitmentFromDisclosureProof)(proofData);
|
|
2022
2031
|
const calculatedParamCommitment = await (0, import_utils.getFacematchParameterCommitment)(
|
|
2023
2032
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
2024
2033
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
2025
2034
|
BigInt(facematchCommittedInputs.appId),
|
|
2026
|
-
|
|
2027
|
-
// facematchCommittedInputs.mode === "regular" ? 1n : 2n,
|
|
2028
|
-
1n
|
|
2035
|
+
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
2029
2036
|
);
|
|
2030
2037
|
if (paramCommittment !== calculatedParamCommitment) {
|
|
2031
2038
|
console.warn("The FaceMatch verification does not match the ones from the proof");
|