Skip to content

Commit

Permalink
circuit: rename to regex.cirocm
Browse files Browse the repository at this point in the history
  • Loading branch information
saleel committed Apr 1, 2024
1 parent b1d2052 commit 2c575d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/circuits/email-verifier.circom
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ template EmailVerifier(maxHeaderLength, maxBodyLength, n, k, ignoreBodyHashCheck
bhRegexMatch === 1;

var shaB64Length = 44; // Length of SHA-256 hash when base64 encoded - ceil(32 / 3) * 4
signal bhBase64[shaB64Length] <== ExtractRegexReveal(maxHeaderLength, shaB64Length)(bhReveal, bodyHashIndex);
signal bhBase64[shaB64Length] <== SelectRegexReveal(maxHeaderLength, shaB64Length)(bhReveal, bodyHashIndex);
signal headerBodyHash[32] <== Base64Decode(32)(bhBase64);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ include "circomlib/circuits/comparators.circom";
include "circomlib/circuits/bitify.circom";
include "./bytes.circom";

/// @title ExtractRegexReveal
/// @notice Extracts reveal part from a regex match
/// @title SelectRegexReveal
/// @notice Returns reveal bytes of a regex match from the input
/// @notice Verifies data before and after (maxRevealLen) reveal part is zero
/// @param maxArrayLen Maximum length of the input array
/// @param maxRevealLen Maximum length of the reveal part
/// @input in Input array
/// @input startIndex Index of the start of the reveal part
/// @output out Revealed data array
template ExtractRegexReveal(maxArrayLen, maxRevealLen) {
template SelectRegexReveal(maxArrayLen, maxRevealLen) {
signal input in[maxArrayLen];
signal input startIndex;

Expand Down Expand Up @@ -65,7 +65,7 @@ template PackRegexReveal(maxArrayLen, maxRevealLen) {

signal output out[chunkSize];

component extractor = ExtractRegexReveal(maxArrayLen, maxRevealLen);
component extractor = SelectRegexReveal(maxArrayLen, maxRevealLen);
extractor.in <== in;
extractor.startIndex <== startIndex;

Expand Down

0 comments on commit 2c575d5

Please sign in to comment.