aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-09-14 10:04:55 +0200
committerMattias Andrée <maandree@kth.se>2024-09-14 10:04:55 +0200
commitaade49d09c5bf56bbed52c4b6fef20e286f73e3f (patch)
tree7a083bbeed4a921dafd6bd48e1e6ecd2c23db53e
parentEmpty signed commit (diff)
downloadlibkeccak-aade49d09c5bf56bbed52c4b6fef20e286f73e3f.tar.gz
libkeccak-aade49d09c5bf56bbed52c4b6fef20e286f73e3f.tar.bz2
libkeccak-aade49d09c5bf56bbed52c4b6fef20e286f73e3f.tar.xz
Fix bug where the hash is incomplete and possiblity corrupt when the bitrate is not a multiple of the word size
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--digest.c2
1 files changed, 1 insertions, 1 deletions
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;