2 * Copyright (C) 2005-2008 Martin Willi
3 * Copyright (C) 2005 Jan Hutter
4 * Hochschule fuer Technik Rapperswil
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * @defgroup sha1_hasher sha1_hasher
22 #ifndef SHA1_HASHER_H_
23 #define SHA1_HASHER_H_
25 typedef struct sha1_hasher_t sha1_hasher_t
;
26 typedef struct sha1_keyed_prf_t sha1_keyed_prf_t
;
28 #include <crypto/hashers/hasher.h>
29 #include <crypto/prfs/prf.h>
32 * Implementation of hasher_t interface using the SHA1 algorithm.
34 struct sha1_hasher_t
{
37 * Implements hasher_t interface.
39 hasher_t hasher_interface
;
43 * Implementation of prf_t interface using keyed SHA1 algorithm (used for EAP-AKA).
45 struct sha1_keyed_prf_t
{
48 * Implements prf_t interface.
54 * Creates a new sha1_hasher_t.
56 * @param algo algorithm, must be HASH_SHA1
57 * @return sha1_hasher_t object
59 sha1_hasher_t
*sha1_hasher_create(hash_algorithm_t algo
);
62 * Creates a new sha1_keyed_prf_t.
64 * @param algo algorithm, must be PRF_KEYED_SHA1
65 * @return sha1_keyed_prf_tobject
67 sha1_keyed_prf_t
*sha1_keyed_prf_create(pseudo_random_function_t algo
);
69 #endif /*SHA1_HASHER_H_ @}*/