Skip to content

Commit

Permalink
fix: check email length <= max
Browse files Browse the repository at this point in the history
  • Loading branch information
lonerapier committed Sep 19, 2023
1 parent 9f68bc8 commit d42897b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/twitter-verifier-circuits/twitter.circom
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ template TwitterVerifier(max_header_bytes, max_body_bytes, n, k, pack_size, expo
signal (from_regex_out, from_regex_reveal[max_header_bytes]) <== FromRegex(max_header_bytes)(in_padded);
log(from_regex_out);
from_regex_out === 1;
in_padded[email_from_idx+max_email_from_len] === 0; // adversary can't use email len > max allowed
reveal_email_from_packed <== ShiftAndPack(max_header_bytes, max_email_from_len, pack_size)(from_regex_reveal, email_from_idx);
}

Expand Down

0 comments on commit d42897b

Please sign in to comment.