From 6c23261fc4111584e1406586ec8e6db15a766ca4 Mon Sep 17 00:00:00 2001 From: Ayush Shukla Date: Tue, 18 Aug 2026 17:27:19 +0200 Subject: [PATCH] Avoid materializing round constants array --- keccak/src/backends/soft.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keccak/src/backends/soft.rs b/keccak/src/backends/soft.rs index f3ad673..d2c07e5 100644 --- a/keccak/src/backends/soft.rs +++ b/keccak/src/backends/soft.rs @@ -115,6 +115,8 @@ pub(crate) fn keccak_p(state: &mut [L; PLEN]) let round_consts = RC[..L::KECCAK_F_ROUND_COUNT] .last_chunk::() .expect("Number of rounds greater than `KECCAK_F_ROUND_COUNT` is not supported!") + .iter() + .copied() .map(L::truncate_rc); // Not unrolling this loop results in a much smaller function, plus