diff --git a/integration_test.go b/integration_test.go index 95c2ccc926..4c2fb49a25 100644 --- a/integration_test.go +++ b/integration_test.go @@ -44,11 +44,6 @@ func TestIntegrationAPI(t *testing.T) { opts = append(opts, test.WithInvalidAssignment(tData.InvalidAssignments[i])) } - if name == "multi-output-hint" { - // TODO @gbotrel FIXME - opts = append(opts, test.NoFuzzing()) - } - assert.CheckCircuit(tData.Circuit, opts...) }, name) } diff --git a/internal/backend/circuits/hint.go b/internal/backend/circuits/hint.go index 2489ce1eab..93e88f124c 100644 --- a/internal/backend/circuits/hint.go +++ b/internal/backend/circuits/hint.go @@ -148,8 +148,21 @@ var make3 = func(_ *big.Int, inputs []*big.Int, result []*big.Int) error { } var dvHint = func(_ *big.Int, inputs []*big.Int, res []*big.Int) error { + // Check that inputs and outputs have the same length + if len(inputs) != len(res) { + return fmt.Errorf("dvHint: expected same length for inputs and results, got %d inputs and %d results", len(inputs), len(res)) + } + + // Ensure we have at least one input to process + if len(inputs) == 0 { + return fmt.Errorf("dvHint: no inputs provided") + } + two := big.NewInt(2) for i := range inputs { + if inputs[i] == nil { + return fmt.Errorf("dvHint: input at index %d is nil", i) + } res[i].Mul(two, inputs[i]) } return nil