Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions noir_stdlib/src/hash/keccak.nr
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@ pub(crate) fn keccak256<let N: u32>(input: [u8; N], message_size: u32) -> [u8; 3
// means we need to swap our byte ordering
let num_limbs = max_blocks * LIMBS_PER_BLOCK; //max_blocks_length / WORD_SIZE;
for i in 0..num_limbs {
let mut temp = [0; WORD_SIZE];
let word_size_times_i = WORD_SIZE * i;
for j in 0..WORD_SIZE {
temp[j] = block_bytes[word_size_times_i+j];
}
for j in 0..WORD_SIZE {
block_bytes[word_size_times_i + j] = temp[7 - j];
for j in 0..WORD_SIZE / 2 {
let temp = block_bytes[word_size_times_i + 7 - j];
block_bytes[word_size_times_i + 7 - j] = block_bytes[word_size_times_i+j];
block_bytes[word_size_times_i + j] = temp;
}
}

Expand Down