fix ofac tests and move ofac to utils/passport/ofac repo

This commit is contained in:
turnoffthiscomputer
2024-12-15 13:42:53 +01:00
parent 222084acc1
commit 655882fded
8 changed files with 23 additions and 25 deletions

View File

@@ -8,7 +8,7 @@ include "../utils/passport/date/isValid.circom";
include "../utils/passport/passportVerifier.circom";
include "../disclose/disclose.circom";
include "../disclose/proveCountryIsNotInList.circom";
include "../ofac/ofac_name.circom";
include "../utils/passport/ofac/ofac_name.circom";
template OPENPASSPORT_PROVE(signatureAlgorithm, n, k, MAX_ECONTENT_PADDED_LEN, MAX_SIGNED_ATTR_PADDED_LEN, FORBIDDEN_COUNTRIES_LIST_LENGTH) {
var kLengthFactor = getKLengthFactor(signatureAlgorithm);

View File

@@ -1,3 +1,3 @@
pragma circom 2.1.9;
include "../../ofac/ofac_name_dob.circom";
include "../../utils/passport/ofac/ofac_name_dob.circom";
component main { public [ smt_root ] } = OFAC_NAME_DOB();

View File

@@ -1,3 +1,3 @@
pragma circom 2.1.9;
include "../../ofac/ofac_name.circom";
include "../../utils/passport/ofac/ofac_name.circom";
component main { public [ smt_root ] } = OFAC_NAME();

View File

@@ -1,3 +1,3 @@
pragma circom 2.1.9;
include "../../ofac/ofac_passport_number.circom";
include "../../utils/passport/ofac/ofac_passport_number.circom";
component main { public [ smt_root ] } = OFAC_PASSPORT_NUMBER();

View File

@@ -1,10 +1,10 @@
pragma circom 2.1.9;
include "../utils/circomlib/hasher/hash.circom";
include "../utils/circomlib/bitify/comparators.circom";
include "../utils/other/binary-merkle-root/binary-merkle-root.circom";
include "../utils/other/getCommonLength.circom";
include "../utils/other/smt.circom";
include "../../circomlib/hasher/hash.circom";
include "../../circomlib/bitify/comparators.circom";
include "../../other/binary-merkle-root/binary-merkle-root.circom";
include "../../other/getCommonLength.circom";
include "../../other/smt.circom";
template OFAC_NAME() {

View File

@@ -1,11 +1,10 @@
pragma circom 2.1.9;
include "../utils/circomlib/hasher/hash.circom";
include "../utils/circomlib/bitify/comparators.circom";
include "../utils/circomlib/bitify/bitify.circom";
include "../utils/other/binary-merkle-root/binary-merkle-root.circom";
include "../utils/other/getCommonLength.circom";
include "../utils/other/smt.circom";
include "../../circomlib/hasher/hash.circom";
include "../../circomlib/bitify/comparators.circom";
include "../../other/binary-merkle-root/binary-merkle-root.circom";
include "../../other/getCommonLength.circom";
include "../../other/smt.circom";
template OFAC_NAME_DOB() {
@@ -19,7 +18,7 @@ template OFAC_NAME_DOB() {
for (var j = 0; j < 3; j++) {
poseidon_hasher[j] = PoseidonHash(13);
for (var i = 0; i < 13; i++) {
poseidon_hasher[j].inputs[i] <== dg1[10 + 13 * j + i];
poseidon_hasher[j].in[i] <== dg1[10 + 13 * j + i];
}
poseidon_hasher[j].dummy <== 0;
}
@@ -28,7 +27,7 @@ template OFAC_NAME_DOB() {
// Dob hash
component pos_dob = PoseidonHash(6);
for(var i = 0; i < 6; i++) {
pos_dob.inputs[i] <== dg1[62 + i];
pos_dob.in[i] <== dg1[62 + i];
}
pos_dob.dummy <== 0;

View File

@@ -1,12 +1,10 @@
pragma circom 2.1.9;
include "circom-dl/circuits/hasher/hash.circom";
include "circom-dl/circuits/bitify/comparators.circom";
include "circom-dl/circuits/bitify/bitify.circom";
include "../utils/other/array.circom";
include "binary-merkle-root.circom";
include "../utils/other/getCommonLength.circom";
include "../utils/other/smt.circom";
include "../../circomlib/hasher/hash.circom";
include "../../circomlib/bitify/comparators.circom";
include "../../other/binary-merkle-root/binary-merkle-root.circom";
include "../../other/getCommonLength.circom";
include "../../other/smt.circom";
template OFAC_PASSPORT_NUMBER() {
@@ -19,7 +17,7 @@ template OFAC_PASSPORT_NUMBER() {
component poseidon_hasher = PoseidonHash(9);
for (var i = 0; i < 9; i++) {
poseidon_hasher.inputs[i] <== dg1[49 + i];
poseidon_hasher.in[i] <== dg1[49 + i];
}
poseidon_hasher.dummy <== 0;
signal output ofacCheckResult <== SMTVerify(256)(poseidon_hasher.out, smt_leaf_value, smt_root, smt_siblings, 0);

View File

@@ -88,6 +88,7 @@ describe('OFAC - Passport number match', function () {
const ofacCheckResult = (await circuit.getOutput(w, ['ofacCheckResult'])).ofacCheckResult;
expect(ofacCheckResult).to.equal('0');
});
});
// Level 2: NameDob match in OfacList