aboutsummaryrefslogtreecommitdiffstats
path: root/libblake_blake2b_digest_get_required_input_size.c
blob: 12288dffbcb6c3b9565016af7814305a5dc4d0af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* See LICENSE file for copyright and license details. */
#include "common.h"

size_t
libblake_blake2b_digest_get_required_input_size(size_t len)
{
	size_t blocks, rem;
	blocks = len >> 7;
	rem = len & 127;
	if (rem)
		blocks += 1;
	return blocks << 7;
}