From 5aa54454616fa5d0d18a61132629ffe6ef816f7d Mon Sep 17 00:00:00 2001 From: Richard Hartmann Date: Tue, 16 Feb 2010 20:25:39 +0800 Subject: [PATCH] --- yaml --- r: 181018 b: refs/heads/master c: 189bd4b056af76325e491baea4338a140d0e86d8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/crypto/anubis.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index 38186556b35a..70b3c96c313e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5357c6c43ec0f420c33da91019ae24e17a929ece +refs/heads/master: 189bd4b056af76325e491baea4338a140d0e86d8 diff --git a/trunk/crypto/anubis.c b/trunk/crypto/anubis.c index e42c3a8ba4aa..77530d571c96 100644 --- a/trunk/crypto/anubis.c +++ b/trunk/crypto/anubis.c @@ -469,14 +469,13 @@ static int anubis_setkey(struct crypto_tfm *tfm, const u8 *in_key, u32 kappa[ANUBIS_MAX_N]; u32 inter[ANUBIS_MAX_N]; - switch (key_len) - { + switch (key_len) { case 16: case 20: case 24: case 28: case 32: case 36: case 40: break; default: *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; - return - EINVAL; + return -EINVAL; } ctx->key_len = key_len * 8; @@ -530,23 +529,24 @@ static int anubis_setkey(struct crypto_tfm *tfm, const u8 *in_key, /* * compute kappa^{r+1} from kappa^r: */ - if (r == R) { + if (r == R) break; - } for (i = 0; i < N; i++) { int j = i; inter[i] = T0[(kappa[j--] >> 24) ]; - if (j < 0) j = N - 1; + if (j < 0) + j = N - 1; inter[i] ^= T1[(kappa[j--] >> 16) & 0xff]; - if (j < 0) j = N - 1; + if (j < 0) + j = N - 1; inter[i] ^= T2[(kappa[j--] >> 8) & 0xff]; - if (j < 0) j = N - 1; + if (j < 0) + j = N - 1; inter[i] ^= T3[(kappa[j ] ) & 0xff]; } kappa[0] = inter[0] ^ rc[r]; - for (i = 1; i < N; i++) { + for (i = 1; i < N; i++) kappa[i] = inter[i]; - } } /* @@ -690,7 +690,7 @@ static struct crypto_alg anubis_alg = { static int __init anubis_mod_init(void) { int ret = 0; - + ret = crypto_register_alg(&anubis_alg); return ret; }