-
Notifications
You must be signed in to change notification settings - Fork 28
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
[SPEC] is_eq gadget #76
Comments
OverviewDenoting the input wires as As a Constraint SystemIt's sufficient to define a gate with one input and one output that is 1 iff input is 0 and output is 0 iff input is non-zero.
In the case that That r1cs system can be written as a composition of gates... [to do] |
@GhostOfGauss I added a gadget example in the description, although it's not working properly yet. To avoid having to pass |
I've added an |
I've opened a PR webb-tools/ark-plonk#1 |
PR ZK-Garage/plonk#77 has been merged and resolves this issue. |
The basic equation goes like this:
Where:
x
is the number we want to check.x_inverse
is the inverse ofx
(meaningx * x_inverse == 1
).b
is the boolean value indicating ifx
is0
.Here is the gadget example:
The full code can be found here: https://github.com/webb-tools/arkworks-gadgets/blob/filip/iz-zero-gadget/arkworks-plonk-circuits/src/utils.rs
The text was updated successfully, but these errors were encountered: