Add features support to af_alg plugin
[strongswan.git] / src / libstrongswan / plugins / af_alg / af_alg_prf.h
1 /*
2 * Copyright (C) 2010 Martin Willi
3 * Copyright (C) 2010 revosec AG
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup af_alg_prf af_alg_prf
18 * @{ @ingroup af_alg
19 */
20
21 #ifndef AF_ALG_PRF_H_
22 #define AF_ALG_PRF_H_
23
24 typedef struct af_alg_prf_t af_alg_prf_t;
25
26 #include <plugins/plugin.h>
27 #include <crypto/prfs/prf.h>
28
29 /** Number of PRFs */
30 #define AF_ALG_PRF 7
31
32 /**
33 * Implementation of PRFs using AF_ALG.
34 */
35 struct af_alg_prf_t {
36
37 /**
38 * Implements prf_t interface.
39 */
40 prf_t prf;
41 };
42
43 /**
44 * Creates a new af_alg_prf_t object.
45 *
46 * @param algo algorithm to implement
47 * @return af_alg_prf_t object, NULL if hash not supported
48 */
49 af_alg_prf_t *af_alg_prf_create(pseudo_random_function_t algo);
50
51 /**
52 * Probe algorithms and return plugin features.
53 *
54 * @param features plugin features to create
55 * @param pos current position in features
56 */
57 void af_alg_prf_probe(plugin_feature_t *features, int *pos);
58
59 #endif /** AF_ALG_PRF_H_ @}*/