aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum_init_blakes_hasher.c
blob: f5e7c20c54b56791215d6707dd052ab854fcbf70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* See LICENSE file for copyright and license details. */
#include "common.h"
#ifdef SUPPORT_BLAKES


int
libhashsum_init_blakes_hasher(struct libhashsum_hasher *this, size_t hashbits)
{
	if (hashbits == 224U)
		return libhashsum_init_blake224_hasher(this);
	if (hashbits == 256U)
		return libhashsum_init_blake256_hasher(this);

	errno = EINVAL;
	return -1;
}


#else
int
libhashsum_init_blakes_hasher(struct libhashsum_hasher *this, size_t hashbits)
{
	(void) this;
	(void) hashbits;
	errno = ENOSYS;
	return -1;
}
#endif