We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The first two test circuits below don't work: visibility of zero and sum is 0.
zero
sum
package circuits import ( "testing" "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/frontend" "github.com/stretchr/testify/assert" ) // empty circuits type IsBool1 struct{} type IsBool2 struct{} type IsBool3 struct{} func TestIsBool1(t *testing.T) { var circuit IsBool1 _, err := frontend.Compile(ecc.BN254, backend.GROTH16, &circuit) assert.Nil(t, err, "Circuit compilation failed") } func TestIsBool2(t *testing.T) { var circuit IsBool2 _, err := frontend.Compile(ecc.BN254, backend.GROTH16, &circuit) assert.Nil(t, err, "Circuit compilation failed") } func TestIsBool3(t *testing.T) { var circuit IsBool3 _, err := frontend.Compile(ecc.BN254, backend.GROTH16, &circuit) assert.Nil(t, err, "Circuit compilation failed") } func (c *IsBool1) Define(curve ecc.ID, cs *frontend.ConstraintSystem) error { zero := cs.Constant(0) one := cs.Constant(1) cs.AssertIsBoolean(zero) cs.AssertIsBoolean(one) return nil } func (c *IsBool2) Define(curve ecc.ID, cs *frontend.ConstraintSystem) error { zero := cs.Constant(0) one := cs.Constant(1) sum := cs.Add(zero, one) cs.AssertIsBoolean(sum) return nil } func (c *IsBool3) Define(curve ecc.ID, cs *frontend.ConstraintSystem) error { zero := cs.Constant(0) one := cs.Constant(1) prod := cs.Mul(zero, one) cs.AssertIsBoolean(prod) return nil }
The text was updated successfully, but these errors were encountered:
test: added test from #136
bc8ad3a
fix: can constraint linear expressions to be boolean fixes #136
b3f263a
No branches or pull requests
The first two test circuits below don't work: visibility of
zero
andsum
is 0.The text was updated successfully, but these errors were encountered: