You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Circuit defines a simple circuit
// x**3 + x + 5 == y
type Circuit struct {
// struct tags on a variable is optional
// default uses variable name and secret visibility.
D Data
}
type Data struct {
X frontend.Variable `gnark:"x"`
Y frontend.Variable `gnark:",public"`
}
// Define declares the circuit constraints
// x**3 + x + 5 == y
func (circuit Circuit) Define(curveID ecc.ID, api frontend.API) error {
x3 := api.Mul(circuit.D.X, circuit.D.X, circuit.D.X)
api.AssertIsEqual(circuit.D.Y, api.Add(x3, circuit.D.X, 5))
return nil
}
Note the method definition on Circuit, not *Circuit.
The frontend.Compile doesn't allocate Variables correctly in this case.
The text was updated successfully, but these errors were encountered:
Note the method definition on Circuit, not *Circuit.
The
frontend.Compile
doesn't allocate Variables correctly in this case.The text was updated successfully, but these errors were encountered: