Skip to content

Commit

Permalink
Merge branch 'master' into perf/ec-arithmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
yelhousni committed Mar 12, 2024
2 parents 3ce0ffa + bb26665 commit ce6b81c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions std/math/emulated/field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math/big"
"testing"

"github.com/consensys/gnark/constraint/solver"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
"github.com/consensys/gnark/test"
Expand Down Expand Up @@ -183,7 +184,7 @@ func testHint[T FieldParams](t *testing.T) {
Denominator: ValueOf[T](b),
Expected: ValueOf[T](c),
}
assert.CheckCircuit(&circuit, test.WithValidAssignment(&witness))
assert.CheckCircuit(&circuit, test.WithValidAssignment(&witness), test.WithSolverOpts(solver.WithHints(nnaHint)))
}

func TestHint(t *testing.T) {
Expand Down Expand Up @@ -241,7 +242,7 @@ func testHintNativeInput[T FieldParams](t *testing.T) {
Denominator: b,
Expected: ValueOf[T](c),
}
assert.CheckCircuit(&circuit, test.WithValidAssignment(&witness), test.WithCurves(testCurve))
assert.CheckCircuit(&circuit, test.WithValidAssignment(&witness), test.WithCurves(testCurve), test.WithSolverOpts(solver.WithHints(nativeInputHint)))
}

func TestHintNativeInput(t *testing.T) {
Expand Down Expand Up @@ -281,6 +282,7 @@ func (c *hintNativeOutputCircuit[T]) Define(api frontend.API) error {
return err
}
api.AssertIsEqual(res[0], c.Expected)
api.AssertIsDifferent(c.Expected, 0)
return nil
}

Expand All @@ -299,7 +301,7 @@ func testHintNativeOutput[T FieldParams](t *testing.T) {
Denominator: ValueOf[T](b),
Expected: c,
}
assert.CheckCircuit(&circuit, test.WithValidAssignment(&witness), test.WithCurves(testCurve))
assert.CheckCircuit(&circuit, test.WithValidAssignment(&witness), test.WithCurves(testCurve), test.WithSolverOpts(solver.WithHints(nativeOutputHint)))
}

func TestHintNativeOutput(t *testing.T) {
Expand Down

0 comments on commit ce6b81c

Please sign in to comment.