aboutsummaryrefslogtreecommitdiff
path: root/crypto/michael_mic.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-05-16 22:09:29 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2006-06-26 17:34:39 +1000
commit6c2bb98bc33ae33c7a33a133a4cd5a06395fece5 (patch)
tree96684cd2c473cd05d651ce1fa3dd72b1b4b19b09 /crypto/michael_mic.c
parent43600106e32809a4dead79fec67a63e9860e3d5d (diff)
[CRYPTO] all: Pass tfm instead of ctx to algorithms
Up until now algorithms have been happy to get a context pointer since they know everything that's in the tfm already (e.g., alignment, block size). However, once we have parameterised algorithms, such information will be specific to each tfm. So the algorithm API needs to be changed to pass the tfm structure instead of the context pointer. This patch is basically a text substitution. The only tricky bit is the assembly routines that need to get the context pointer offset through asm-offsets.h. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/michael_mic.c')
-rw-r--r--crypto/michael_mic.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/crypto/michael_mic.c b/crypto/michael_mic.c
index 701f859ed76..d061da21cfd 100644
--- a/crypto/michael_mic.c
+++ b/crypto/michael_mic.c
@@ -45,16 +45,17 @@ do { \
} while (0)
-static void michael_init(void *ctx)
+static void michael_init(struct crypto_tfm *tfm)
{
- struct michael_mic_ctx *mctx = ctx;
+ struct michael_mic_ctx *mctx = crypto_tfm_ctx(tfm);
mctx->pending_len = 0;
}
-static void michael_update(void *ctx, const u8 *data, unsigned int len)
+static void michael_update(struct crypto_tfm *tfm, const u8 *data,
+ unsigned int len)
{
- struct michael_mic_ctx *mctx = ctx;
+ struct michael_mic_ctx *mctx = crypto_tfm_ctx(tfm);
const __le32 *src;
if (mctx->pending_len) {
@@ -90,9 +91,9 @@ static void michael_update(void *ctx, const u8 *data, unsigned int len)
}
-static void michael_final(void *ctx, u8 *out)
+static void michael_final(struct crypto_tfm *tfm, u8 *out)
{
- struct michael_mic_ctx *mctx = ctx;
+ struct michael_mic_ctx *mctx = crypto_tfm_ctx(tfm);
u8 *data = mctx->pending;
__le32 *dst = (__le32 *)out;
@@ -121,10 +122,10 @@ static void michael_final(void *ctx, u8 *out)
}
-static int michael_setkey(void *ctx, const u8 *key, unsigned int keylen,
- u32 *flags)
+static int michael_setkey(struct crypto_tfm *tfm, const u8 *key,
+ unsigned int keylen, u32 *flags)
{
- struct michael_mic_ctx *mctx = ctx;
+ struct michael_mic_ctx *mctx = crypto_tfm_ctx(tfm);
const __le32 *data = (const __le32 *)key;
if (keylen != 8) {