Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG FIX] Fix SelectRegexReveal #200

Merged
merged 2 commits into from
May 28, 2024
Merged

[BUG FIX] Fix SelectRegexReveal #200

merged 2 commits into from
May 28, 2024

Conversation

SoraSuegami
Copy link
Collaborator

@SoraSuegami SoraSuegami commented May 28, 2024

Description

When the startIndex in SelectRegexReveal was large enough, GreaterThan(bitLength) at the line 36 of regex.circom failed because its second argument startIndex + maxRevealLen - 1 was larger than bitLength=log2Ceil(maxArrayLen) bits.
This bug made tests in ether-email-auth failed.

I fixed that definition of bitLength to bitLength=log2Ceil(maxArrayLen + maxRevealLen - 1), allowing the maximum length of the second argument.
I confirmed that circuit tests in zk-email-verify and the above tests in ether-email-auth passed on my local environment after this fix.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have discussed with the team prior to submitting this PR
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@SoraSuegami SoraSuegami requested a review from saleel May 28, 2024 11:50
@saleel saleel merged commit 8ea11a0 into main May 28, 2024
5 checks passed
@saleel saleel deleted the pr/fix-regex-circom branch May 28, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants