Skip to content

Commit

Permalink
fix: empty keccak value
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagofneto committed Nov 1, 2023
1 parent fe88255 commit ac9c33b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hashing/keccak.cairo
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use cairo_lib::utils::types::words64::{Words64, bytes_used_u64};
use keccak::cairo_keccak;

const EMPTY_KECCAK: u256 = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
const EMPTY_KECCAK: u256 = 0x70A4855D04D8FA7B3B2782CA53B600E5C003C7DCB27D7E923C23F7860146D2C5;

// @notice Wrapper arround cairo_keccak that format the input for compatibility with EVM
// @param words The input data, as a list of 64-bit little-endian words
// @param last_word_bytes Number of bytes in the last word
// @return The keccak hash of the input, matching the output of the EVM's keccak256 opcode
// @return The little endian keccak hash of the input, matching the output of the EVM's keccak256 opcode
fn keccak_cairo_words64(words: Words64, last_word_bytes: usize) -> u256 {
if words.is_empty() {
return EMPTY_KECCAK;
Expand Down

0 comments on commit ac9c33b

Please sign in to comment.