Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
implements XOR gadget #1177
implements XOR gadget #1177
Changes from all commits
ca2959b
990730d
b108d96
9584382
09e3f37
ca54b50
b69ac01
f3bfc03
77cd4ae
03c138a
957cd54
24acc09
a1b5c94
89aebb7
f9def76
8235424
6d79928
ea423df
bb61d3c
6f081c9
cd1cbbe
f9a0935
e29c3bf
54f0a74
03fe713
33db00d
bce7ffe
70ba811
458bd46
5b87fb7
8f9c9a8
f3505cf
08c5d10
92de8ec
8991e3b
1c25be8
598bdd0
35dfd8a
d0c0592
1d4a2dd
a24bc2d
fd91ab1
eec0cb8
0540b67
ac9eb59
82c89e5
7817dde
aa9b9ae
b5b34b0
e1c22af
eb8143b
043f0ef
36830a8
1f54f64
7c01398
d162672
09ad52e
5df6d8b
13b0701
4a8978f
fa408e8
08a5115
09cad2c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I am not familiar with the types in o1js so this might be a basic question. Is converting to BigInt the desired behavior here? Since the inputs are
Field
, I wonder why this conversion needs to take place.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.
This case only happens if both elements are constants (not variables that the prover needs to provide). Because of that, we can just convert them to bigint and do our computation there and convert them back. Doing so is more efficient than going through snarky and letting snarky do the calculation on constants. This is a change we did somewhat recently: Computations on constants are done on native javascript types
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.
Oooh, interesting, thank you
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.
Also, note that using a smaller length can let the verifier infer the length of the inputs. So even if the zkapp developer knew that the inputs to some program will be <32bits, they should still consider if they truly want a smaller gadget or a larger one that leaks less side information about the data.
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.
Uhhh this is actually a super good point, I love that!