diff options
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 e42c3a8ba4aa..77530d571c96 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, | |||
469 | u32 kappa[ANUBIS_MAX_N]; | 469 | u32 kappa[ANUBIS_MAX_N]; |
470 | u32 inter[ANUBIS_MAX_N]; | 470 | u32 inter[ANUBIS_MAX_N]; |
471 | 471 | ||
472 | switch (key_len) | 472 | switch (key_len) { |
473 | { | ||
474 | case 16: case 20: case 24: case 28: | 473 | case 16: case 20: case 24: case 28: |
475 | case 32: case 36: case 40: | 474 | case 32: case 36: case 40: |
476 | break; | 475 | break; |
477 | default: | 476 | default: |
478 | *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; | 477 | *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; |
479 | return - EINVAL; | 478 | return -EINVAL; |
480 | } | 479 | } |
481 | 480 | ||
482 | ctx->key_len = key_len * 8; | 481 | ctx->key_len = key_len * 8; |
@@ -530,23 +529,24 @@ static int anubis_setkey(struct crypto_tfm *tfm, const u8 *in_key, | |||
530 | /* | 529 | /* |
531 | * compute kappa^{r+1} from kappa^r: | 530 | * compute kappa^{r+1} from kappa^r: |
532 | */ | 531 | */ |
533 | if (r == R) { | 532 | if (r == R) |
534 | break; | 533 | break; |
535 | } | ||
536 | for (i = 0; i < N; i++) { | 534 | for (i = 0; i < N; i++) { |
537 | int j = i; | 535 | int j = i; |
538 | inter[i] = T0[(kappa[j--] >> 24) ]; | 536 | inter[i] = T0[(kappa[j--] >> 24) ]; |
539 | if (j < 0) j = N - 1; | 537 | if (j < 0) |
538 | j = N - 1; | ||
540 | inter[i] ^= T1[(kappa[j--] >> 16) & 0xff]; | 539 | inter[i] ^= T1[(kappa[j--] >> 16) & 0xff]; |
541 | if (j < 0) j = N - 1; | 540 | if (j < 0) |
541 | j = N - 1; | ||
542 | inter[i] ^= T2[(kappa[j--] >> 8) & 0xff]; | 542 | inter[i] ^= T2[(kappa[j--] >> 8) & 0xff]; |
543 | if (j < 0) j = N - 1; | 543 | if (j < 0) |
544 | j = N - 1; | ||
544 | inter[i] ^= T3[(kappa[j ] ) & 0xff]; | 545 | inter[i] ^= T3[(kappa[j ] ) & 0xff]; |
545 | } | 546 | } |
546 | kappa[0] = inter[0] ^ rc[r]; | 547 | kappa[0] = inter[0] ^ rc[r]; |
547 | for (i = 1; i < N; i++) { | 548 | for (i = 1; i < N; i++) |
548 | kappa[i] = inter[i]; | 549 | kappa[i] = inter[i]; |
549 | } | ||
550 | } | 550 | } |
551 | 551 | ||
552 | /* | 552 | /* |
@@ -690,7 +690,7 @@ static struct crypto_alg anubis_alg = { | |||
690 | static int __init anubis_mod_init(void) | 690 | static int __init anubis_mod_init(void) |
691 | { | 691 | { |
692 | int ret = 0; | 692 | int ret = 0; |
693 | 693 | ||
694 | ret = crypto_register_alg(&anubis_alg); | 694 | ret = crypto_register_alg(&anubis_alg); |
695 | return ret; | 695 | return ret; |
696 | } | 696 | } |