2 * Copyright (C) 2010 Martin Willi
3 * Copyright (C) 2010 revosec AG
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>.
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
16 #include "af_alg_plugin.h"
20 #include "af_alg_hasher.h"
21 #include "af_alg_signer.h"
22 #include "af_alg_prf.h"
23 #include "af_alg_crypter.h"
25 typedef struct private_af_alg_plugin_t private_af_alg_plugin_t
;
28 * private data of af_alg_plugin
30 struct private_af_alg_plugin_t
{
35 af_alg_plugin_t
public;
38 METHOD(plugin_t
, get_name
, char*,
39 private_af_alg_plugin_t
*this)
44 METHOD(plugin_t
, get_features
, int,
45 private_af_alg_plugin_t
*this, plugin_feature_t
*features
[])
47 static plugin_feature_t f
[AF_ALG_HASHER
+ AF_ALG_SIGNER
+
48 AF_ALG_PRF
+ AF_ALG_CRYPTER
+ 4] = {};
52 { /* initialize only once */
53 f
[count
++] = PLUGIN_REGISTER(HASHER
, af_alg_hasher_create
);
54 af_alg_hasher_probe(f
, &count
);
55 f
[count
++] = PLUGIN_REGISTER(SIGNER
, af_alg_signer_create
);
56 af_alg_signer_probe(f
, &count
);
57 f
[count
++] = PLUGIN_REGISTER(PRF
, af_alg_prf_create
);
58 af_alg_prf_probe(f
, &count
);
59 f
[count
++] = PLUGIN_REGISTER(CRYPTER
, af_alg_crypter_create
);
60 af_alg_crypter_probe(f
, &count
);
66 METHOD(plugin_t
, destroy
, void,
67 private_af_alg_plugin_t
*this)
75 plugin_t
*af_alg_plugin_create()
77 private_af_alg_plugin_t
*this;
82 .get_name
= _get_name
,
83 .get_features
= _get_features
,
89 return &this->public.plugin
;