Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8131878d authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Herbert Xu
Browse files

crypto: padlock/aes - switch to library version of key expansion routine



Switch to the new AES library that also provides an implementation of
the AES key expansion routine. This removes the dependency on the
generic AES cipher, allowing it to be omitted entirely in the future.

Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 1d2c3279
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@ config CRYPTO_DEV_PADLOCK_AES
	tristate "PadLock driver for AES algorithm"
	tristate "PadLock driver for AES algorithm"
	depends on CRYPTO_DEV_PADLOCK
	depends on CRYPTO_DEV_PADLOCK
	select CRYPTO_BLKCIPHER
	select CRYPTO_BLKCIPHER
	select CRYPTO_AES
	select CRYPTO_LIB_AES
	help
	help
	  Use VIA PadLock for AES algorithm.
	  Use VIA PadLock for AES algorithm.


+1 −1
Original line number Original line Diff line number Diff line
@@ -145,7 +145,7 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
	ctx->cword.encrypt.keygen = 1;
	ctx->cword.encrypt.keygen = 1;
	ctx->cword.decrypt.keygen = 1;
	ctx->cword.decrypt.keygen = 1;


	if (crypto_aes_expand_key(&gen_aes, in_key, key_len)) {
	if (aes_expandkey(&gen_aes, in_key, key_len)) {
		*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
		*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
		return -EINVAL;
		return -EINVAL;
	}
	}