Updated Message Hashing with Cairo's hash_state
#49
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.
Updated Message Hashing with Cairo's
hash_state
Summary
This PR includes the Account contract's custom hash_message and hash_calldata functions refactored to include Cairo's hash_state as referenced in #37 . The
hash_message()
function first invokeshash_calldata()
and saves the reference locally before utilizinghash_state_ptr
to iterate through the rest of the message.Cairo's hash_state.py provides
compute_hash_on_elements()
to greatly simplify testing. The Signer.py module is updated with this function accordingly.Implementation
hash2()
functions from Account.cairo and Signer.pyhash_state
in bothhash_message()
andhash_calldata()
compute_hash_on_elements()
appropriately in the Signer.py moduleFuture
hash_calldata()
from the Account contract altogether