-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(avm/public): user space PublicContext::get_args_hash (#8292)
This PR implements `PublicContext::get_args_hash` in user space. We are still passing the calldata length as a runtime variable until we can get it at compile time. This requires @Thunkar 's work on `aztec(public)` as a macro. Once that is done, we'll pass the hasher as a closure when creating the PublicContext, i.e.: ``` struct PublicContext { hash_getter: fn[(Field,)]() -> Field, // ... } impl PublicContext { pub fn new(..., hash_getter) -> Self { // ... } fn get_args_hash(self) -> Field { (self.hash_getter)() } } // In the aztec(public) macro comptime let N = get_calldata_length(); let hash_getter = || { let mut hasher = ArgsHasher::new(); let mut fields = std::meta::unquote!(quote { [0; $N] }); fields = calldata_copy(2 /*or 1*/, N); hasher.add_many(fields); hasher.hash() }; let context = PublicContext::new(..., hash_getter); ```
- Loading branch information
Showing
9 changed files
with
122 additions
and
13 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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