crypto/qat: fix SM3 auth mode
PATCH 1/1 crypto/qat: fix SM3 auth mode
The SM3 auth mode is now set to 0 for QAT, to support plain hash only. This should also be added to the capabilities for GEN3 and GEN4. SM3 HMAC is not supported.
--- drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 3 +++ drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c | 3 +++ drivers/crypto/qat/qat_sym_session.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c +3 -0
@@ -152,6 +152,9 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen3[] = {QAT_SYM_CIPHER_CAP (SM4_CTR ,CAP_SET (block_size,16 ),CAP_RNG (key_size,16 ,16 ,0 ),CAP_RNG (iv_size,16 ,16 ,0 )), +QAT_SYM_PLAIN_AUTH_CAP (SM3 , +CAP_SET (block_size,64 ), +CAP_RNG (digest_size,32 ,32 ,0 )), RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() };
drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c +3 -0
@@ -100,6 +100,9 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen4[] = {QAT_SYM_CIPHER_CAP (SM4_CTR ,CAP_SET (block_size,16 ),CAP_RNG (key_size,16 ,16 ,0 ),CAP_RNG (iv_size,16 ,16 ,0 )), +QAT_SYM_PLAIN_AUTH_CAP (SM3 , +CAP_SET (block_size,64 ), +CAP_RNG (digest_size,32 ,32 ,0 )), RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() };
drivers/crypto/qat/qat_sym_session.c +1 -1
@@ -697,7 +697,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,switch (auth_xform->algo) {case RTE_CRYPTO_AUTH_SM3 : session->qat_hash_alg =ICP_QAT_HW_AUTH_ALGO_SM3 ; - session->auth_mode =ICP_QAT_HW_AUTH_MODE2 ; + session->auth_mode =ICP_QAT_HW_AUTH_MODE0 ;break ;case RTE_CRYPTO_AUTH_SHA1 : session->qat_hash_alg =ICP_QAT_HW_AUTH_ALGO_SHA1 ;
Signature · 1 line
2.25.1
Quoted 39 lines
-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Wednesday, March 1, 2023 2:59 PM
To: Ji, Kai <[email protected]>
Cc: [email protected]; Power, Ciara <[email protected]>; Kusztal, ArkadiuszX <[email protected]>; [email protected]
Subject: [PATCH]crypto/qat: fix SM3 auth modeThe SM3 auth mode is now set to 0 for QAT, to support plain hash only. This should also be added to the capabilities for GEN3 and GEN4. SM3 HMAC is not supported.
Fixes 75fd4bbc94ab ("crypto/qat: support SM3 hash algorithm")Signed-off-by Ciara Power <[email protected]>--- drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 3 +++ drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c | 3 +++ drivers/crypto/qat/qat_sym_session.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-)drivers/crypto/qat/qat_sym_session.c +1
-1@@ -697,7 +697,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev, switch (auth_xform->algo) {case RTE_CRYPTO_AUTH_SM3 : session->qat_hash_alg =ICP_QAT_HW_AUTH_ALGO_SM3 ; - session->auth_mode =ICP_QAT_HW_AUTH_MODE2 ; + session->auth_mode =ICP_QAT_HW_AUTH_MODE0 ;break ;case RTE_CRYPTO_AUTH_SHA1 :
Quoted 3 lines
session->qat_hash_alg=ICP_QAT_HW_AUTH_ALGO_SHA1;
--
2.25.1
Akhil Goyal
AppliedQuoted 6 lines
Quoted 6 lines
Subject: [PATCH]
crypto/qat: fix SM3 auth modeThe SM3 auth mode is now set to 0 for QAT, to support plain hash only. This should also be added to the capabilities for GEN3 and GEN4. SM3 HMAC is not supported.
Quoted 6 lines
Quoted 5 lines
Fixes 75fd4bbc94ab ("crypto/qat: support SM3 hash algorithm")Signed-off-by Ciara Power <[email protected]>Acked-by Arek Kusztal <[email protected]>
Applied to dpdk-next-crypto
Thanks.