Add features support to af_alg plugin
[strongswan.git] / src / libstrongswan / plugins / af_alg / af_alg_crypter.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_crypter af_alg_crypter
18 * @{ @ingroup af_alg
19 */
20
21 #ifndef AF_ALG_CRYPTER_H_
22 #define AF_ALG_CRYPTER_H_
23
24 typedef struct af_alg_crypter_t af_alg_crypter_t;
25
26 #include <plugins/plugin.h>
27 #include <crypto/crypters/crypter.h>
28
29 /** Number of crypters */
30 #define AF_ALG_CRYPTER 25
31
32 /**
33 * Implementation of signers using AF_ALG.
34 */
35 struct af_alg_crypter_t {
36
37 /**
38 * The crypter_t interface.
39 */
40 crypter_t crypter;
41 };
42
43 /**
44 * Constructor to create af_alg_crypter_t.
45 *
46 * @param algo algorithm to implement
47 * @param key_size key size in bytes
48 * @return af_alg_crypter_t, NULL if not supported
49 */
50 af_alg_crypter_t *af_alg_crypter_create(encryption_algorithm_t algo,
51 size_t key_size);
52
53 /**
54 * Probe algorithms and return plugin features.
55 *
56 * @param features plugin features to create
57 * @param pos current position in features
58 */
59 void af_alg_crypter_probe(plugin_feature_t *features, int *pos);
60
61 #endif /** AF_ALG_CRYPTER_H_ @}*/