github.com/consensys/gnark@v0.11.0/internal/backend/circuits/assertequal.go (about) 1 package circuits 2 3 import ( 4 "github.com/consensys/gnark/frontend" 5 ) 6 7 type checkAssertEqualCircuit struct { 8 X frontend.Variable 9 Y frontend.Variable `gnark:",public"` 10 } 11 12 func (circuit *checkAssertEqualCircuit) Define(api frontend.API) error { 13 api.AssertIsEqual(circuit.X, circuit.Y) 14 return nil 15 } 16 17 func init() { 18 19 var circuit, good, bad checkAssertEqualCircuit 20 21 good.X = (3) 22 good.Y = (3) 23 24 bad.X = (5) 25 bad.Y = (2) 26 27 addEntry("assert_equal", &circuit, &good, &bad, nil) 28 }