Implemented crypter on top of AF_ALG

This commit is contained in:
Martin Willi
2010-12-20 09:52:02 +01:00
parent e75e1c9473
commit a5c973b955
4 changed files with 362 additions and 1 deletions
@@ -19,6 +19,7 @@
#include "af_alg_hasher.h"
#include "af_alg_signer.h"
#include "af_alg_crypter.h"
typedef struct private_af_alg_plugin_t private_af_alg_plugin_t;
@@ -40,6 +41,8 @@ METHOD(plugin_t, destroy, void,
(hasher_constructor_t)af_alg_hasher_create);
lib->crypto->remove_signer(lib->crypto,
(signer_constructor_t)af_alg_signer_create);
lib->crypto->remove_crypter(lib->crypto,
(crypter_constructor_t)af_alg_crypter_create);
free(this);
}
@@ -101,5 +104,18 @@ plugin_t *af_alg_plugin_create()
lib->crypto->add_signer(lib->crypto, AUTH_CAMELLIA_XCBC_96,
(signer_constructor_t)af_alg_signer_create);
lib->crypto->add_crypter(lib->crypto, ENCR_DES,
(crypter_constructor_t)af_alg_crypter_create);
lib->crypto->add_crypter(lib->crypto, ENCR_3DES,
(crypter_constructor_t)af_alg_crypter_create);
lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC,
(crypter_constructor_t)af_alg_crypter_create);
lib->crypto->add_crypter(lib->crypto, ENCR_AES_CTR,
(crypter_constructor_t)af_alg_crypter_create);
lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CBC,
(crypter_constructor_t)af_alg_crypter_create);
lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CTR,
(crypter_constructor_t)af_alg_crypter_create);
return &this->public.plugin;
}