@@ -73,7 +73,7 @@ config CRYPTO_AES_ARM_BS
depends on KERNEL_MODE_NEON
select CRYPTO_BLKCIPHER
select CRYPTO_SIMD
- select CRYPTO_AES
+ select CRYPTO_AES_TI
help
Use a faster and more secure NEON based implementation of AES in CBC,
CTR and XTS modes
@@ -68,7 +68,7 @@ config CRYPTO_AES_ARM64_NEON_BLK
tristate "AES in ECB/CBC/CTR/XTS modes using NEON instructions"
depends on ARM64 && KERNEL_MODE_NEON
select CRYPTO_BLKCIPHER
- select CRYPTO_AES
+ select CRYPTO_AES_TI
select CRYPTO_SIMD
config CRYPTO_CHACHA20_NEON
@@ -1201,7 +1201,7 @@ EXPORT_SYMBOL_GPL(crypto_il_tab);
} while (0)
/**
- * crypto_aes_expand_key - Expands the AES key as described in FIPS-197
+ * aes_expand_key - Expands the AES key as described in FIPS-197
* @ctx: The location where the computed key will be stored.
* @in_key: The supplied key.
* @key_len: The length of the supplied key.
@@ -1214,7 +1214,7 @@ EXPORT_SYMBOL_GPL(crypto_il_tab);
* described in FIPS-197. The first slot (16 bytes) of each key (enc or dec) is
* for the initial combination, the second slot for the first round and so on.
*/
-int crypto_aes_expand_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
+static int aes_expand_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
unsigned int key_len)
{
u32 i, t, u, v, w, j;
@@ -1271,7 +1271,6 @@ int crypto_aes_expand_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
}
return 0;
}
-EXPORT_SYMBOL_GPL(crypto_aes_expand_key);
/**
* crypto_aes_set_key - Set the AES key.
@@ -1291,7 +1290,7 @@ int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
u32 *flags = &tfm->crt_flags;
int ret;
- ret = crypto_aes_expand_key(ctx, in_key, key_len);
+ ret = aes_expand_key(ctx, in_key, key_len);
if (!ret)
return 0;
@@ -167,8 +167,8 @@ static u32 subw(u32 in)
(__aesti_sbox[(in >> 24) & 0xff] << 24);
}
-static int aesti_expand_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
- unsigned int key_len)
+int crypto_aes_expand_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
+ unsigned int key_len)
{
u32 kwords = key_len / sizeof(u32);
u32 rc, i, j;
@@ -232,6 +232,7 @@ static int aesti_expand_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
return 0;
}
+EXPORT_SYMBOL_GPL(crypto_aes_expand_key);
static int aesti_set_key(struct crypto_tfm *tfm, const u8 *in_key,
unsigned int key_len)
@@ -239,7 +240,7 @@ static int aesti_set_key(struct crypto_tfm *tfm, const u8 *in_key,
struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
int err;
- err = aesti_expand_key(ctx, in_key, key_len);
+ err = crypto_aes_expand_key(ctx, in_key, key_len);
if (err)
return err;
@@ -26,7 +26,7 @@ config CRYPTO_DEV_PADLOCK_AES
tristate "PadLock driver for AES algorithm"
depends on CRYPTO_DEV_PADLOCK
select CRYPTO_BLKCIPHER
- select CRYPTO_AES
+ select CRYPTO_AES_TI
help
Use VIA PadLock for AES algorithm.
@@ -189,7 +189,7 @@ config CRYPTO_CRC32_S390
config CRYPTO_DEV_MV_CESA
tristate "Marvell's Cryptographic Engine"
depends on PLAT_ORION
- select CRYPTO_AES
+ select CRYPTO_AES_TI
select CRYPTO_BLKCIPHER
select CRYPTO_HASH
select SRAM
@@ -203,7 +203,7 @@ config CRYPTO_DEV_MV_CESA
config CRYPTO_DEV_MARVELL_CESA
tristate "New Marvell's Cryptographic Engine driver"
depends on PLAT_ORION || ARCH_MVEBU
- select CRYPTO_AES
+ select CRYPTO_AES_TI
select CRYPTO_DES
select CRYPTO_BLKCIPHER
select CRYPTO_HASH
Both the original generic AES code and the new fixed-time AES driver contain C implementations of crypto_aes_expand_key() which are functionally equivalent to each other. However, the former version pulls in crypto/aes_generic.o in its entirety, consisting of 16 KB of lookup tables and fully unrolled encrypt and decrypt routines, none of which are of any interest to most users of crypto_aes_expand_key. So unexport the version in crypto/aes_generic.o, and export the version in crypto/aes_ti.o, and fix up all Kconfig dependencies of users of crypto_aes_expand_key. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> --- arch/arm/crypto/Kconfig | 2 +- arch/arm64/crypto/Kconfig | 2 +- crypto/aes_generic.c | 7 +++---- crypto/aes_ti.c | 7 ++++--- drivers/crypto/Kconfig | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) -- 2.7.4