From aade49d09c5bf56bbed52c4b6fef20e286f73e3f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 14 Sep 2024 10:04:55 +0200 Subject: Fix bug where the hash is incomplete and possiblity corrupt when the bitrate is not a multiple of the word size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- digest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digest.c b/digest.c index 7ab288d..6a81f80 100644 --- a/digest.c +++ b/digest.c @@ -319,7 +319,7 @@ libkeccak_squeezing_phase(register struct libkeccak_state *restrict state, long long int nn, long int ww, register unsigned char *restrict hashsum) { register int_fast64_t v; - register long int ni = rr / ww; + register long int ni = rr / ww + !!(rr % ww); auto long int olen = state->n; auto long int i, j = 0; register long int k; -- cgit v1.2.3-70-g09d2