Skip to content

Commit

Permalink
Added utils and changed imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Metachaser24 committed Mar 17, 2024
1 parent 504c119 commit 4fa4426
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/circuits/emailtest.circom
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ include "circomlib/circuits/comparators.circom";
include "circomlib/circuits/poseidon.circom";
include "@zk-email/circuits/email-verifier.circom";
include "@zk-email/circuits/helpers/extract.circom";
include "./utils/constants.circom";
include "./utils/email_addr_pointer.circom";
include "./utils/email_addr_commit.circom";
include "./utils/hash_sign.circom";
include "./utils/email_nullifier.circom";
include "@zk-email/circuits/utils/constants.circom";
include "@zk-email/circuits/utils/email_addr_pointer.circom";
include "@zk-email/circuits/utils/email_addr_commit.circom";
include "@zk-email/circuits/utils/hash_sign.circom";
include "@zk-email/circuits/utils/email_nullifier.circom";
include "./utils/bytes2ints.circom";
include "./utils/digit2int.circom";
include "@zk-email/zk-regex-circom/circuits/common/from_addr_regex.circom";
Expand Down
18 changes: 18 additions & 0 deletions packages/circuits/utils/email_addr_pointer.circom
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

pragma circom 2.1.5;

include "circomlib/circuits/poseidon.circom";

// email_addr_pointer = hash(relayerRand, emailAddr||0..0)
template EmailAddrPointer(num_ints) {
signal input relayer_rand;
signal input email_addr_ints[num_ints];
signal output pointer;

component poseidon = Poseidon(1+num_ints);
poseidon.inputs[0] <== relayer_rand;
for(var i=0; i<num_ints; i++) {
poseidon.inputs[1+i] <== email_addr_ints[i];
}
pointer <== poseidon.out;
}

0 comments on commit 4fa4426

Please sign in to comment.