Skip to content

Commit

Permalink
fix ofac tests and move ofac to utils/passport/ofac repo
Browse files Browse the repository at this point in the history
  • Loading branch information
remicolin committed Dec 15, 2024
1 parent 222084a commit 655882f
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion circuits/circuits/prove/openpassport_prove.circom
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion circuits/circuits/tests/ofac/ofac_name_dob_tester.circom
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion circuits/circuits/tests/ofac/ofac_name_tester.circom
Original file line number Diff line number Diff line change
@@ -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();
Original file line number Diff line number Diff line change
@@ -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();
Original file line number Diff line number Diff line change
@@ -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() {

Expand Down
Original file line number Diff line number Diff line change
@@ -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() {

Expand All @@ -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;
}
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {

Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions circuits/tests/ofac/ofac.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 655882f

Please sign in to comment.