46d05f03a29ac1f968b9d65ba7031050229e74d8
[strongswan.git] / src / libstrongswan / plugins / hmac / hmac_prf.h
1 /*
2 * Copyright (C) 2008 Martin Willi
3 * Copyright (C) 2005 Jan Hutter
4 * Hochschule fuer Technik Rapperswil
5 *
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>.
10 *
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
14 * for more details.
15 */
16
17 /**
18 * @defgroup hmac_prf hmac_prf
19 * @{ @ingroup hmac_p
20 */
21
22 #ifndef PRF_HMAC_H_
23 #define PRF_HMAC_H_
24
25 typedef struct hmac_prf_t hmac_prf_t;
26
27 #include <crypto/prfs/prf.h>
28
29 /**
30 * Implementation of prf_t interface using the HMAC algorithm.
31 *
32 * This simply wraps a hmac_t in a prf_t. More a question of
33 * interface matching.
34 */
35 struct hmac_prf_t {
36
37 /**
38 * Generic prf_t interface for this hmac_prf_t class.
39 */
40 prf_t prf_interface;
41 };
42
43 /**
44 * Creates a new hmac_prf_t object.
45 *
46 * @param algo algorithm to implement
47 * @return hmac_prf_t object, NULL if hash not supported
48 */
49 hmac_prf_t *hmac_prf_create(pseudo_random_function_t algo);
50
51 #endif /*PRF_HMAC_SHA1_H_ @}*/