aboutsummaryrefslogtreecommitdiffstats
path: root/libblake_blake2s_digest_get_required_input_size.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-01-16 16:13:33 +0100
committerMattias Andrée <maandree@kth.se>2022-01-16 16:13:33 +0100
commit085134812d3014b6ec53980f93c6f2e818bab2e4 (patch)
treee4212da97d96e5d0841eb158b51c7359d29f20ee /libblake_blake2s_digest_get_required_input_size.c
parentAdd *_force_update for BLAKE2[X] (intended for parallel hashing) (diff)
downloadlibblake-1.0.tar.gz
libblake-1.0.tar.bz2
libblake-1.0.tar.xz
Fix libblake_blake2[sn]_digest_get_required_input_size for 0 input1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libblake_blake2s_digest_get_required_input_size.c')
-rw-r--r--libblake_blake2s_digest_get_required_input_size.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libblake_blake2s_digest_get_required_input_size.c b/libblake_blake2s_digest_get_required_input_size.c
index c356822..f5f45cd 100644
--- a/libblake_blake2s_digest_get_required_input_size.c
+++ b/libblake_blake2s_digest_get_required_input_size.c
@@ -7,7 +7,7 @@ libblake_blake2s_digest_get_required_input_size(size_t len)
size_t blocks, rem;
blocks = len >> 6;
rem = len & 63;
- if (rem)
+ if (rem || !blocks)
blocks += 1;
return blocks << 6;
}