Skip to contentSkip to conversation

crypto: chelsio - Use library to prepare HMAC keys

PATCH In review Eric Biggers 2 participants 2 messages Sep 5, 2025 – Sep 13, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 crypto: chelsio - Use library to prepare HMAC keys

To prepare HMAC keys, just use the library functions instead of crypto_shash. This is much simpler, avoids depending on the fragile export_core and import_core methods, and is faster too.

---

This is the same diff as v1, but with an updated commit message and now targeting cryptodev/master instead of libcrypto-fixes. Since I'm going with
https://lore.kernel.org/r/[email protected]/ to fix the reported regression instead, this patch is now "just" a library conversion and not a fix per se. If needed I'd be glad to take this through libcrypto-next instead, but usually these conversions have been going through subsystem trees (which is Herbert's in this case).

 drivers/crypto/chelsio/Kconfig       |   6 +-
 drivers/crypto/chelsio/chcr_algo.c   | 259 +++++++--------------------
 drivers/crypto/chelsio/chcr_crypto.h |   1 -
 3 files changed, 63 insertions(+), 203 deletions(-)
drivers/crypto/chelsio/Kconfig +3 -3
index 5dd3f6a4781a2..37294bb740031 100644
@@ -2,13 +2,13 @@
 config CRYPTO_DEV_CHELSIO
 	tristate "Chelsio Crypto Co-processor Driver"
 	depends on CHELSIO_T4
 	select CRYPTO_LIB_AES
 	select CRYPTO_LIB_GF128MUL
-	select CRYPTO_SHA1
-	select CRYPTO_SHA256
-	select CRYPTO_SHA512
+	select CRYPTO_LIB_SHA1
+	select CRYPTO_LIB_SHA256
+	select CRYPTO_LIB_SHA512
 	select CRYPTO_AUTHENC
 	help
 	  The Chelsio Crypto Co-processor driver for T6 adapters.
 
 	  For general information about Chelsio and our products, visit
drivers/crypto/chelsio/chcr_algo.c +60 -199

371 lines not on this page · raw message

drivers/crypto/chelsio/chcr_crypto.h +0 -1
index 1d693b8436e6f..e1e79e5f01e75 100644
@@ -239,11 +239,10 @@ struct chcr_aead_ctx {
 	u16 mayverify;
 	struct	__aead_ctx ctx[];
 };
 
 struct hmac_ctx {
-	struct crypto_shash *base_hash;
 	u8 ipad[CHCR_HASH_MAX_BLOCK_SIZE_128];
 	u8 opad[CHCR_HASH_MAX_BLOCK_SIZE_128];
 };
 
 struct __crypto_ctx {

base-commit: 41eab2a95950682cdc9c5e60cb3457e29f186540

Signature · 1 line
2.50.1
maintainer
#1 lore raw
Quoted 16 lines · Eric Biggers

To prepare HMAC keys, just use the library functions instead of crypto_shash. This is much simpler, avoids depending on the fragile export_core and import_core methods, and is faster too.

---

This is the same diff as v1, but with an updated commit message and now targeting cryptodev/master instead of libcrypto-fixes. Since I'm going with
https://lore.kernel.org/r/[email protected]/ to fix the reported regression instead, this patch is now "just" a library conversion and not a fix per se. If needed I'd be glad to take this through libcrypto-next instead, but usually these conversions have been going through subsystem trees (which is Herbert's in this case).

Quoted 4 lines
drivers/crypto/chelsio/Kconfig       |   6 +-
drivers/crypto/chelsio/chcr_algo.c   | 259 +++++++--------------------
drivers/crypto/chelsio/chcr_crypto.h |   1 -
3 files changed, 63 insertions(+), 203 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt