-
Notifications
You must be signed in to change notification settings - Fork 182
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
feat: allow hashing Fiat-Shamir transcript challenge without hashing to field first #474
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ivokub
added
consolidate
strengthen an existing feature
zk-evm
P1: High
Issue priority: high
labels
Dec 19, 2023
10 tasks
Seems there is some incompatibility with gnark still. |
📦
|
gbotrel
approved these changes
Dec 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
Fixes #467.
This PR allows to avoid hashing to field before we hash the challenge name into the transcript. The problem with the current approach was that it wasn't that well compatible with gnark counterpart when doing recursion in-circuit.
The obvious solution was to add options to conditionally allow altering the behaviour of Fiat-Shamir instance, but this created another problem as currently the challenge names were already given as variadic arguments and we cannot have multiple.
So, I removed mandatory challenge name fixing when initializing transcript and added an option to optionally fix them. Now, if the challenge names are not given then we can bind to new challenges on the go.
This allowed to add the option for avoiding the hash to field before hashing the challenge name into the transcript. Added edge case check where if hash to field is requested but we do not have the method.
This fix breaks usage of Fiat-Shamir transcript, but it is fixed in gnark-crypto and I'm also pushing changes to gnark. See Consensys/gnark#974
Type of change
Please delete options that are not relevant.
How has this been tested?
Tests work. Also checked that fixes the issue in zkevm.
How has this been benchmarked?
Not benchmarked.
Checklist:
golangci-lint
does not output errors locally