Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas @ StarkWare <[email protected]>
  • Loading branch information
enitrat and 0xLucqs authored Sep 20, 2023
1 parent e974ab8 commit ca55ce7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/math/src/keccak256.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use keccak::{cairo_keccak};
use keccak::cairo_keccak;

#[generate_trait]
impl U64Impl of U64Trait {
Expand Down Expand Up @@ -44,10 +44,9 @@ fn reverse_endianness(value: u256) -> u256 {
/// # Returns
///
/// A `u256` value representing the Keccak hash of the input bytes array.
fn keccak256(mut self: Array<u8>) -> u256 {
fn keccak256(mut self: Span<u8>) -> u256 {
// Converts byte array to little endian 8 byte words array.
let mut words64: Array<u64> = Default::default();
let mut self = self.span();
let (last_word, last_word_bytes) = loop {
// Specifically handle last word
if self.len() < 8 {
Expand Down

0 comments on commit ca55ce7

Please sign in to comment.