Migrated hmac plugin to INIT/METHOD macros

This commit is contained in:
Martin Willi
2010-08-13 17:11:53 +02:00
parent af403cafa1
commit 5ab7d9c296
6 changed files with 105 additions and 143 deletions
+6 -6
View File
@@ -32,10 +32,8 @@ struct private_hmac_plugin_t {
hmac_plugin_t public;
};
/**
* Implementation of hmac_plugin_t.hmactroy
*/
static void destroy(private_hmac_plugin_t *this)
METHOD(plugin_t, destroy, void,
private_hmac_plugin_t *this)
{
lib->crypto->remove_prf(lib->crypto,
(prf_constructor_t)hmac_prf_create);
@@ -49,9 +47,11 @@ static void destroy(private_hmac_plugin_t *this)
*/
plugin_t *hmac_plugin_create()
{
private_hmac_plugin_t *this = malloc_thing(private_hmac_plugin_t);
private_hmac_plugin_t *this;
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
INIT(this,
.public.plugin.destroy = _destroy,
);
lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256,
(prf_constructor_t)hmac_prf_create);