Skip to content
New issue

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

Solver hints supported by test engine, signature of hints changed to big.Int #161

Merged
merged 3 commits into from
Nov 3, 2021

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Oct 29, 2021

Hint functions now have the following signature:

type Function func(curveID ecc.ID, inputs []*big.Int, result *big.Int) error

and can be used like so:

func (circuit *hintCircuit) Define(curveID ecc.ID, api frontend.API) error {
	a7 := api.NewHint(mulBy7, circuit.A)
// ...
}

func mulBy7(curveID ecc.ID, inputs []*big.Int, result *big.Int) error {
	result.Mul(inputs[0], big.NewInt(7)).Mod(result, curveID.Info().Fr.Modulus())
	return nil
}

This enables to implement one hint function for all curves, and enable support of api.NewHint in the big.Int test engine.

@gbotrel gbotrel added this to the v0.6.0 milestone Oct 29, 2021
@gbotrel gbotrel merged commit 481475a into develop Nov 3, 2021
@gbotrel gbotrel deleted the test-engine-with-hints branch November 3, 2021 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant