Skip to content

Commit

Permalink
Update from_addr regex and test codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Oct 2, 2023
1 parent 3cb6e54 commit 03887f6
Show file tree
Hide file tree
Showing 18 changed files with 1,131 additions and 1,260 deletions.
8 changes: 4 additions & 4 deletions packages/circom/circuits/common/email_addr_regex.circom
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ template EmailAddrRegex(msg_bytes) {
signal output reveal0[msg_bytes];
for (var i = 0; i < msg_bytes; i++) {
is_substr0[i][0] <== 0;
is_substr0[i][1] <== is_substr0[i][0] + states[i+1][1] * states[i+2][2];
is_substr0[i][2] <== is_substr0[i][1] + states[i+1][2] * states[i+2][3];
is_substr0[i][3] <== is_substr0[i][2] + states[i+1][1] * states[i+2][1];
is_substr0[i][4] <== is_substr0[i][3] + states[i+1][0] * states[i+2][1];
is_substr0[i][1] <== is_substr0[i][0] + states[i+1][0] * states[i+2][1];
is_substr0[i][2] <== is_substr0[i][1] + states[i+1][1] * states[i+2][1];
is_substr0[i][3] <== is_substr0[i][2] + states[i+1][1] * states[i+2][2];
is_substr0[i][4] <== is_substr0[i][3] + states[i+1][2] * states[i+2][3];
is_substr0[i][5] <== is_substr0[i][4] + states[i+1][3] * states[i+2][3];
is_reveal0[i] <== is_substr0[i][5] * is_consecutive[i][1];
reveal0[i] <== in[i+1] * is_reveal0[i];
Expand Down
20 changes: 20 additions & 0 deletions packages/circom/circuits/common/email_addr_with_name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"max_byte_size": 1024,
"parts": [
{
"is_public": false,
"regex_def": "(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9|_|\\.|\"| |@)+<",
"max_size": 256
},
{
"is_public": true,
"regex_def": "(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9|_|\\.|-)+@(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9|_|\\.|-)+",
"max_size": 256
},
{
"is_public": false,
"regex_def": ">",
"max_size": 1
}
]
}
Loading

0 comments on commit 03887f6

Please sign in to comment.