-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: substring matching #17
Conversation
ea967b8
to
577152f
Compare
Nice! I'll give this a longer review tomorrow! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I'm just looking to have these comments/questions resolved, then can approve.
Nothing major! Looks good!
# Profile | ||
9 * `dataLen` constraints | ||
|
||
NOTE: Modified from https://github.com/zkemail/zk-email-verify/tree/main/packages/circuits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should look through the audit to see if this was hit then: https://www.zksecurity.xyz/reports/zkemail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's currently not in upstream zkemail code, have a PR open.
Thanks for the amazing review @Autoparallel. Will incorporate these changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now! Just bring it up to date with main.
If you want multiple files in utils/
, I'm happy with that choice :)
rebased with main. In the end, I decided to move utils circuits in separate files :) |
Adds a substring matching circuit using random linear combination.
circomlib
and import from circomlib directly using circom's-l
flag.SubstringSearch
to compute probable position ofkey
indata
. So, a malicious prover can set invalidposition
.position
is verified by a properly constrainedSubstringMatchWithIndex
functionConstraint count for
dataLength: 787
andkeyLength: 10
Most of these constraints are due to Poseidon hash used to calculate a random number for linear combination.
r
can't be public constant or even private input, because then the verification is prone to failure, and should be properly initiated using a random oracle.