diff options
Diffstat (limited to 'libblake_blake384_digest_get_required_input_size.c')
-rw-r--r-- | libblake_blake384_digest_get_required_input_size.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libblake_blake384_digest_get_required_input_size.c b/libblake_blake384_digest_get_required_input_size.c index 23bdda2..b9737b0 100644 --- a/libblake_blake384_digest_get_required_input_size.c +++ b/libblake_blake384_digest_get_required_input_size.c @@ -4,5 +4,11 @@ size_t libblake_blake384_digest_get_required_input_size(size_t len, size_t bits, const char *suffix) { - return libblake_blake512_digest_get_required_input_size(len, bits, suffix); + bits += suffix ? strlen(suffix) : 0; + len += bits >> 3; + bits &= 7; + bits += (len & 127) << 3; + len &= ~(size_t)127; + len += (size_t)128 << (bits >= 1024 - (1 + 2 * 64)); + return len; } |