anubis.c (0898782247ae533d1f4e47a06bc5d4870931b284) | anubis.c (674f368a952c48ede71784935a799a5205b92b6c) |
---|---|
1/* 2 * Cryptographic API. 3 * 4 * Anubis Algorithm 5 * 6 * The Anubis algorithm was developed by Paulo S. L. M. Barreto and 7 * Vincent Rijmen. 8 * --- 450 unchanged lines hidden (view full) --- 459 0xf726ffedU, 0xe89d6f8eU, 0x19a0f089U, 460}; 461 462static int anubis_setkey(struct crypto_tfm *tfm, const u8 *in_key, 463 unsigned int key_len) 464{ 465 struct anubis_ctx *ctx = crypto_tfm_ctx(tfm); 466 const __be32 *key = (const __be32 *)in_key; | 1/* 2 * Cryptographic API. 3 * 4 * Anubis Algorithm 5 * 6 * The Anubis algorithm was developed by Paulo S. L. M. Barreto and 7 * Vincent Rijmen. 8 * --- 450 unchanged lines hidden (view full) --- 459 0xf726ffedU, 0xe89d6f8eU, 0x19a0f089U, 460}; 461 462static int anubis_setkey(struct crypto_tfm *tfm, const u8 *in_key, 463 unsigned int key_len) 464{ 465 struct anubis_ctx *ctx = crypto_tfm_ctx(tfm); 466 const __be32 *key = (const __be32 *)in_key; |
467 u32 *flags = &tfm->crt_flags; | |
468 int N, R, i, r; 469 u32 kappa[ANUBIS_MAX_N]; 470 u32 inter[ANUBIS_MAX_N]; 471 472 switch (key_len) { 473 case 16: case 20: case 24: case 28: 474 case 32: case 36: case 40: 475 break; 476 default: | 467 int N, R, i, r; 468 u32 kappa[ANUBIS_MAX_N]; 469 u32 inter[ANUBIS_MAX_N]; 470 471 switch (key_len) { 472 case 16: case 20: case 24: case 28: 473 case 32: case 36: case 40: 474 break; 475 default: |
477 *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; | |
478 return -EINVAL; 479 } 480 481 ctx->key_len = key_len * 8; 482 N = ctx->key_len >> 5; 483 ctx->R = R = 8 + N; 484 485 /* * map cipher key to initial key state (mu): */ --- 223 unchanged lines hidden --- | 476 return -EINVAL; 477 } 478 479 ctx->key_len = key_len * 8; 480 N = ctx->key_len >> 5; 481 ctx->R = R = 8 + N; 482 483 /* * map cipher key to initial key state (mu): */ --- 223 unchanged lines hidden --- |