[PATCH 2/3] crypto: aes - Boost priority of encryption modes further
From: Eric Biggers
Date: Wed Sep 30 2026 - 15:58:05 EST
Fix a regression where drivers/crypto/ccp/ (priority 300) and
drivers/crypto/padlock-aes.c (priority 400) started being able to
override the AES-NI and/or VAES optimized code (previously priority
400-800).
Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
---
crypto/aes.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/crypto/aes.c b/crypto/aes.c
index fe1f68a38daa..73f3aa856be4 100644
--- a/crypto/aes.c
+++ b/crypto/aes.c
@@ -611,7 +611,7 @@ static struct skcipher_alg skcipher_algs[] = {
.base.cra_name = "ecb(aes)",
.base.cra_driver_name = "ecb-aes-lib",
.base.cra_priority = (IS_ENABLED(CONFIG_RISCV) ||
- IS_ENABLED(CONFIG_X86)) ? 300 : 110,
+ IS_ENABLED(CONFIG_X86)) ? 500 : 110,
.base.cra_blocksize = AES_BLOCK_SIZE,
.base.cra_ctxsize = sizeof(struct aes_key),
.base.cra_module = THIS_MODULE,
@@ -627,7 +627,7 @@ static struct skcipher_alg skcipher_algs[] = {
.base.cra_name = "cbc(aes)",
.base.cra_driver_name = "cbc-aes-lib",
.base.cra_priority = (IS_ENABLED(CONFIG_RISCV) ||
- IS_ENABLED(CONFIG_X86)) ? 300 : 110,
+ IS_ENABLED(CONFIG_X86)) ? 500 : 110,
.base.cra_blocksize = AES_BLOCK_SIZE,
.base.cra_ctxsize = sizeof(struct aes_key),
.base.cra_module = THIS_MODULE,
@@ -655,7 +655,7 @@ static struct skcipher_alg skcipher_algs[] = {
.base.cra_name = "cts(cbc(aes))",
.base.cra_driver_name = "cts-cbc-aes-lib",
.base.cra_priority = (IS_ENABLED(CONFIG_RISCV) ||
- IS_ENABLED(CONFIG_X86)) ? 300 : 110,
+ IS_ENABLED(CONFIG_X86)) ? 500 : 110,
.base.cra_blocksize = AES_BLOCK_SIZE,
.base.cra_ctxsize = sizeof(struct aes_key),
.base.cra_module = THIS_MODULE,
@@ -672,7 +672,7 @@ static struct skcipher_alg skcipher_algs[] = {
.base.cra_name = "ctr(aes)",
.base.cra_driver_name = "ctr-aes-lib",
.base.cra_priority = (IS_ENABLED(CONFIG_RISCV) ||
- IS_ENABLED(CONFIG_X86)) ? 300 : 110,
+ IS_ENABLED(CONFIG_X86)) ? 500 : 110,
.base.cra_blocksize = 1,
.base.cra_ctxsize = sizeof(struct aes_enckey),
.base.cra_module = THIS_MODULE,
@@ -689,7 +689,7 @@ static struct skcipher_alg skcipher_algs[] = {
{
.base.cra_name = "xctr(aes)",
.base.cra_driver_name = "xctr-aes-lib",
- .base.cra_priority = IS_ENABLED(CONFIG_X86) ? 300 : 110,
+ .base.cra_priority = IS_ENABLED(CONFIG_X86) ? 500 : 110,
.base.cra_blocksize = 1,
.base.cra_ctxsize = sizeof(struct aes_enckey),
.base.cra_module = THIS_MODULE,
@@ -713,7 +713,7 @@ static struct skcipher_alg skcipher_algs[] = {
.base.cra_name = "xts(aes)",
.base.cra_driver_name = "xts-aes-lib",
.base.cra_priority = (IS_ENABLED(CONFIG_RISCV) ||
- IS_ENABLED(CONFIG_X86)) ? 300 : 110,
+ IS_ENABLED(CONFIG_X86)) ? 500 : 110,
.base.cra_blocksize = AES_BLOCK_SIZE,
.base.cra_ctxsize = sizeof(struct aes_xts_key),
.base.cra_module = THIS_MODULE,
--
2.55.0