aboutsummaryrefslogblamecommitdiffstats
path: root/libblake_blake224_digest_get_required_input_size.c
blob: bba8eed5755a7eb8600e61e5e1eaa9f26448bbe1 (plain) (tree)
1
2
3
4
5
6





                                                                                             






                                                          
 
/* See LICENSE file for copyright and license details. */
#include "common.h"

size_t
libblake_blake224_digest_get_required_input_size(size_t len, size_t bits, const char *suffix)
{
	bits += suffix ? strlen(suffix) : 0;
	len += bits >> 3;
	bits &= 7;
	bits += (len & 63) << 3;
	len &= ~(size_t)63;
	len += (size_t)64 << (bits >= 512 - (1 + 2 * 32));
	return len;
}