-
Notifications
You must be signed in to change notification settings - Fork 583
feat(sol): vk hashing #16015
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
Merged
Merged
feat(sol): vk hashing #16015
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8ea60d6
feat(sol): vk hashing
Maddiaa0 740a92c
chore: remove todo
Maddiaa0 8fef71b
chore: add doc
Maddiaa0 18f5dd5
chore: scripts/cop_to_cpp.sh
Maddiaa0 b2430f0
fix: key consistency test
Maddiaa0 04114b7
fix: ultra transcript test
Maddiaa0 3eed299
chore: remove magic number
Maddiaa0 c897cde
chore: move vk hash to const outside of struct
Maddiaa0 fa38300
Merge branch 'next' into md/hashing-vk-sol
Maddiaa0 98c1bb4
chore: update copy_to_cpp script
Maddiaa0 1325db6
Merge branch 'next' into md/hashing-vk-sol
Maddiaa0 b54e211
review
Maddiaa0 e783e35
chore: document todo
Maddiaa0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,14 +76,11 @@ class UltraKeccakFlavor : public bb::UltraFlavor { | |
| */ | ||
| fr add_hash_to_transcript(const std::string& domain_separator, Transcript& transcript) const override | ||
| { | ||
| // TODO(https://github.com/AztecProtocol/barretenberg/issues/1427): We need to update this function to look | ||
| // like UltraFlavor's add_hash_to_transcript. Alternatively, the VerificationKey class will go away when we | ||
| // add pairing point aggregation to the solidity verifier. | ||
| uint64_t circuit_size = 1 << this->log_circuit_size; | ||
| transcript.add_to_hash_buffer(domain_separator + "vk_log_circuit_size", circuit_size); | ||
| transcript.add_to_hash_buffer(domain_separator + "vk_num_public_inputs", this->num_public_inputs); | ||
| transcript.add_to_hash_buffer(domain_separator + "vk_pub_inputs_offset", this->pub_inputs_offset); | ||
| return 0; | ||
| // This hash contains a hash of the entire vk - including all of the elements | ||
| const fr hash = this->hash(); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this->hash includes the hashes that i removed here + the hashing of the precomputed commitments |
||
|
|
||
| transcript.add_to_hash_buffer(domain_separator + "vk_hash", hash); | ||
| return hash; | ||
| } | ||
|
|
||
| // Don't statically check for object completeness. | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its a little backwards that the vk hash is dependent on the transcript hm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer just overriding this in the keccak class for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you think so? the hash function used is defined in the transcript, so i think it makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless we pull the hash function to be defined in the flavor, then template it into the transcript + others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the hash of the vk or whatever object isn't fundamentally dependent on the hash we're using for Fiat-Shamir
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i get you, ill leave it as keccak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion with lucas: correct function is to define hash function in flavor - but is fine as it is - ISSUE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AztecProtocol/barretenberg#1498