diff --git a/packages/circuits/emailtest.circom b/packages/circuits/emailtest.circom index 09c71fd50..f369daf44 100644 --- a/packages/circuits/emailtest.circom +++ b/packages/circuits/emailtest.circom @@ -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"; diff --git a/packages/circuits/utils/email_addr_pointer.circom b/packages/circuits/utils/email_addr_pointer.circom new file mode 100644 index 000000000..ea14e7c6f --- /dev/null +++ b/packages/circuits/utils/email_addr_pointer.circom @@ -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