X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=crypto%2Fwp512.c;h=bff28560d66d8de4ce54c7c40f9fba604ecee29d;hb=70740d6c93030b339b4ad17fd58ee135dfc13913;hp=b226a126cfaec6a04efaa9f4919fa5dd77d467da;hpb=1fd5a46dd6bbca3a1275465120caf4748872c2a7;p=linux-2.6-omap-h63xx.git diff --git a/crypto/wp512.c b/crypto/wp512.c index b226a126cfa..bff28560d66 100644 --- a/crypto/wp512.c +++ b/crypto/wp512.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -981,9 +980,9 @@ static void wp512_process_buffer(struct wp512_ctx *wctx) { } -static void wp512_init (void *ctx) { +static void wp512_init(struct crypto_tfm *tfm) { + struct wp512_ctx *wctx = crypto_tfm_ctx(tfm); int i; - struct wp512_ctx *wctx = ctx; memset(wctx->bitLength, 0, 32); wctx->bufferBits = wctx->bufferPos = 0; @@ -993,10 +992,10 @@ static void wp512_init (void *ctx) { } } -static void wp512_update(void *ctx, const u8 *source, unsigned int len) +static void wp512_update(struct crypto_tfm *tfm, const u8 *source, + unsigned int len) { - - struct wp512_ctx *wctx = ctx; + struct wp512_ctx *wctx = crypto_tfm_ctx(tfm); int sourcePos = 0; unsigned int bits_len = len * 8; // convert to number of bits int sourceGap = (8 - ((int)bits_len & 7)) & 7; @@ -1054,9 +1053,9 @@ static void wp512_update(void *ctx, const u8 *source, unsigned int len) } -static void wp512_final(void *ctx, u8 *out) +static void wp512_final(struct crypto_tfm *tfm, u8 *out) { - struct wp512_ctx *wctx = ctx; + struct wp512_ctx *wctx = crypto_tfm_ctx(tfm); int i; u8 *buffer = wctx->buffer; u8 *bitLength = wctx->bitLength; @@ -1087,22 +1086,20 @@ static void wp512_final(void *ctx, u8 *out) wctx->bufferPos = bufferPos; } -static void wp384_final(void *ctx, u8 *out) +static void wp384_final(struct crypto_tfm *tfm, u8 *out) { - struct wp512_ctx *wctx = ctx; u8 D[64]; - wp512_final (wctx, D); + wp512_final(tfm, D); memcpy (out, D, WP384_DIGEST_SIZE); memset (D, 0, WP512_DIGEST_SIZE); } -static void wp256_final(void *ctx, u8 *out) +static void wp256_final(struct crypto_tfm *tfm, u8 *out) { - struct wp512_ctx *wctx = ctx; u8 D[64]; - wp512_final (wctx, D); + wp512_final(tfm, D); memcpy (out, D, WP256_DIGEST_SIZE); memset (D, 0, WP512_DIGEST_SIZE); } @@ -1149,7 +1146,7 @@ static struct crypto_alg wp256 = { .dia_final = wp256_final } } }; -static int __init init(void) +static int __init wp512_mod_init(void) { int ret = 0; @@ -1175,7 +1172,7 @@ out: return ret; } -static void __exit fini(void) +static void __exit wp512_mod_fini(void) { crypto_unregister_alg(&wp512); crypto_unregister_alg(&wp384); @@ -1185,8 +1182,8 @@ static void __exit fini(void) MODULE_ALIAS("wp384"); MODULE_ALIAS("wp256"); -module_init(init); -module_exit(fini); +module_init(wp512_mod_init); +module_exit(wp512_mod_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Whirlpool Message Digest Algorithm");