Skip to content

Commit

Permalink
Merge pull request #200 from zkemail/pr/fix-regex-circom
Browse files Browse the repository at this point in the history
[BUG FIX] Fix SelectRegexReveal
  • Loading branch information
saleel authored May 28, 2024
2 parents 4626ff5 + e56f511 commit 8ea11a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/circuits/utils/regex.circom
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ include "./bytes.circom";
/// @param maxRevealLen Maximum length of the reveal part
/// @input in Input array; assumes elements to be bytes
/// @input startIndex The index from which reveal part starts; assumes a valid index,
/// and `startIndex + maxRevealLen - 1` fits in `ceil(log2((maxArrayLen))` bits.
/// and `startIndex + maxRevealLen - 1` fits in `ceil(log2((maxArrayLen + maxRevealLen - 1))` bits.
/// @output out Revealed data array
template SelectRegexReveal(maxArrayLen, maxRevealLen) {
signal input in[maxArrayLen];
signal input startIndex;

signal output out[maxRevealLen];

var bitLength = log2Ceil(maxArrayLen);
var bitLength = log2Ceil(maxArrayLen + maxRevealLen - 1);

signal isStartIndex[maxArrayLen];
signal isZero[maxArrayLen];
Expand Down

0 comments on commit 8ea11a0

Please sign in to comment.