From 2c575d5807647ba7d057f122c24f04b470ceb036 Mon Sep 17 00:00:00 2001 From: Saleel Date: Mon, 1 Apr 2024 14:52:15 +0530 Subject: [PATCH] circuit: rename to regex.cirocm --- packages/circuits/email-verifier.circom | 2 +- packages/circuits/utils/{extract.circom => regex.circom} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename packages/circuits/utils/{extract.circom => regex.circom} (91%) diff --git a/packages/circuits/email-verifier.circom b/packages/circuits/email-verifier.circom index a8630ca8d..007a5a950 100644 --- a/packages/circuits/email-verifier.circom +++ b/packages/circuits/email-verifier.circom @@ -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); diff --git a/packages/circuits/utils/extract.circom b/packages/circuits/utils/regex.circom similarity index 91% rename from packages/circuits/utils/extract.circom rename to packages/circuits/utils/regex.circom index fec1cfb52..26e7255a7 100644 --- a/packages/circuits/utils/extract.circom +++ b/packages/circuits/utils/regex.circom @@ -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; @@ -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;