diff --git a/circuit/algorithms/src/keccak/mod.rs b/circuit/algorithms/src/keccak/mod.rs index 6ff10555a0..e8b4b62161 100644 --- a/circuit/algorithms/src/keccak/mod.rs +++ b/circuit/algorithms/src/keccak/mod.rs @@ -87,7 +87,7 @@ impl Keccak Self { Self { round_constants: Self::ROUND_CONSTANTS.into_iter().map(|e| U64::constant(console::U64::new(e))).collect(), - rotl: Self::rotl_offsets::(), + rotl: Self::rotl_offsets(), } } } @@ -130,18 +130,18 @@ impl Keccak() -> [usize; MODULO * MODULO] { + fn rotl_offsets() -> [usize; MODULO * MODULO] { let mut rotl = [0; MODULO * MODULO]; let mut x: usize = 1; let mut y: usize = 0; - for t in 0..NUM_ROUNDS { + for t in 0..24 { let rotr = ((t + 1) * (t + 2) / 2) % 64; rotl[x + (y * MODULO)] = (64 - rotr) % 64;