aboutsummaryrefslogblamecommitdiffstats
path: root/libblake_blake2s_digest_get_required_input_size.c
blob: f5f45cdd45c37497a67bb9f8055ab68e0aeb9a0c (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                           
                           


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

size_t
libblake_blake2s_digest_get_required_input_size(size_t len)
{
	size_t blocks, rem;
	blocks = len >> 6;
	rem = len & 63;
	if (rem || !blocks)
		blocks += 1;
	return blocks << 6;
}