aboutsummaryrefslogtreecommitdiffstats
path: root/algorithm_output_size.c
blob: ffba6d8a0f0d5a46c0c7c0221668e4c10343d070 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* See LICENSE file for copyright and license details. */
#include "common.h"


/**
 * Get the output size of an algorithm
 * 
 * @param   algorithm  The hashing algorithm
 * @return             The number of bytes in the output, zero on error
 */
size_t
libsha1_algorithm_output_size(enum libsha1_algorithm algorithm)
{
	switch (algorithm) {
	case LIBSHA1_0: return 20;
	case LIBSHA1_1: return 20;
	default:
		errno = EINVAL;
		return 0;
	}
}