feat: allow configurable hash-to-field function for Groth16 Solidity verifier #1102
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
To allow different compatibility, it is beneficial to support different hash-to-field functions to hash the commitments to field in Solidity contract. This PR extends the
ExportSolidity
method to take in options which allow changing the functions. Later, we could possibly use the extendability to also change the HTF function for PLONK Solidity verifier, but keeping unchanged for now.Also added
TargetSolidity
options for the prover and verifier which chooses all the parameters optimally for Solidity verifier. For PLONK prover it is currently no-op, but this allows more simply to change the hash functions we use within (with corresponding little gas savings).Ref #1094
Type of change
How has this been tested?
In package
backend/solidity
:And the subtests
How has this been benchmarked?
Not benchmarked, only changes Solidity verifier
Checklist:
golangci-lint
does not output errors locally