diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2010-05-16 19:40:56 -0300 |
---|---|---|
committer | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2010-05-16 19:40:56 -0300 |
commit | 1c93dc3bd2d1f3f22f021b036c647db1316a7083 (patch) | |
tree | 1678134117b42ea7af7d7b4c1f10e864d486ae25 /crypto/anubis.c | |
parent | 39fa904443d5fef09dfeb90b94ec9892a5a96a35 (diff) | |
parent | 30800d10f2872689cd78711f26b065494df8bb74 (diff) | |
download | linux-crypto-1c93dc3bd2d1f3f22f021b036c647db1316a7083.tar.gz linux-crypto-1c93dc3bd2d1f3f22f021b036c647db1316a7083.zip |
Merge mainline (v2.6.34-rc7)
Diffstat (limited to 'crypto/anubis.c')
-rw-r--r-- | crypto/anubis.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/crypto/anubis.c b/crypto/anubis.c index e42c3a8b..77530d57 100644 --- a/crypto/anubis.c +++ b/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; } |