2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-18 15:44:02 +08:00

IXP4xx crypto: MOD_AES{128,192,256} already include key size.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
This commit is contained in:
Krzysztof Hałasa 2010-12-28 13:08:18 +01:00 committed by Jason Cooper
parent 4d18dea510
commit 9792eb1d72

View File

@ -750,12 +750,12 @@ static int setup_cipher(struct crypto_tfm *tfm, int encrypt,
} }
if (cipher_cfg & MOD_AES) { if (cipher_cfg & MOD_AES) {
switch (key_len) { switch (key_len) {
case 16: keylen_cfg = MOD_AES128 | KEYLEN_128; break; case 16: keylen_cfg = MOD_AES128; break;
case 24: keylen_cfg = MOD_AES192 | KEYLEN_192; break; case 24: keylen_cfg = MOD_AES192; break;
case 32: keylen_cfg = MOD_AES256 | KEYLEN_256; break; case 32: keylen_cfg = MOD_AES256; break;
default: default:
*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
return -EINVAL; return -EINVAL;
} }
cipher_cfg |= keylen_cfg; cipher_cfg |= keylen_cfg;
} else if (cipher_cfg & MOD_3DES) { } else if (cipher_cfg & MOD_3DES) {