Skip to content

Commit

Permalink
modified comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentash committed Sep 21, 2023
1 parent b229e63 commit 45f4b18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/evm/src/instructions/sha3.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ impl Sha3Impl of Sha3Trait {
let mut last_input_offset = internal::fill_array_with_memory_words(
ref self, ref to_hash, offset, nb_words
);
// Fill array to hash with zeroes for bytes out of memory bound
// which is faster than reading them from memory
to_hash.append_n(0, 4 * nb_zeroes);

// Fill last_input with last bytes to hash
// For cases where the size of bytes to hash isn't a multiple of 8,
// prepare the last bytes to hash into last_input instead of appending
// it to to_hash.
let last_input: u64 = if (size % 32 != 0) {
let loaded = self.memory.load(last_input_offset);
internal::prepare_last_input(ref to_hash, loaded, size % 32)
Expand Down

0 comments on commit 45f4b18

Please sign in to comment.