From ffc17816a5b82eef5c136f409df3313742b25ff9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 19 Feb 2022 10:54:34 +0100 Subject: Add document BLAKE functions and make two functions inline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libblake_blake384_digest_get_required_input_size.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libblake_blake384_digest_get_required_input_size.c') 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; } -- cgit v1.2.3-70-g09d2