patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] crypto/qat: fix stream cipher direction
@ 2022-12-21 14:05 Ciara Power
  2023-01-04 11:52 ` [EXT] " Akhil Goyal
  0 siblings, 1 reply; 2+ messages in thread
From: Ciara Power @ 2022-12-21 14:05 UTC (permalink / raw)
  To: Kai Ji, Fiona Trahe, Arkadiusz Kusztal; +Cc: dev, Ciara Power, stable

Stream ciphers use ENCRYPT mode in HW for both encryption and
decryption operations. This patch adds in an overwrite to always set
ENCRYPT mode for these algorithms.

Fixes: d9b7d5bbc845 ("crypto/qat: add ZUC EEA3/EIA3 capability")
Cc: arkadiuszx.kusztal@intel.com
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 0ebc66f89e..c91acc1e9b 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1849,9 +1849,10 @@ int qat_sym_cd_cipher_set(struct qat_sym_session *cdesc,
 		key_convert = ICP_QAT_HW_CIPHER_NO_CONVERT;
 	} else if (cdesc->qat_cipher_alg == ICP_QAT_HW_CIPHER_ALGO_SNOW_3G_UEA2
 		|| cdesc->qat_cipher_alg ==
-			ICP_QAT_HW_CIPHER_ALGO_ZUC_3G_128_EEA3)
+			ICP_QAT_HW_CIPHER_ALGO_ZUC_3G_128_EEA3) {
 		key_convert = ICP_QAT_HW_CIPHER_KEY_CONVERT;
-	else if (cdesc->qat_dir == ICP_QAT_HW_CIPHER_ENCRYPT)
+		cdesc->qat_dir = ICP_QAT_HW_CIPHER_ENCRYPT;
+	} else if (cdesc->qat_dir == ICP_QAT_HW_CIPHER_ENCRYPT)
 		key_convert = ICP_QAT_HW_CIPHER_NO_CONVERT;
 	else if (cdesc->qat_mode == ICP_QAT_HW_CIPHER_AEAD_MODE)
 		key_convert = ICP_QAT_HW_CIPHER_NO_CONVERT;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [EXT] [PATCH] crypto/qat: fix stream cipher direction
  2022-12-21 14:05 [PATCH] crypto/qat: fix stream cipher direction Ciara Power
@ 2023-01-04 11:52 ` Akhil Goyal
  0 siblings, 0 replies; 2+ messages in thread
From: Akhil Goyal @ 2023-01-04 11:52 UTC (permalink / raw)
  To: Ciara Power, Kai Ji, Fiona Trahe, Arkadiusz Kusztal; +Cc: dev, stable

> Stream ciphers use ENCRYPT mode in HW for both encryption and
> decryption operations. This patch adds in an overwrite to always set
> ENCRYPT mode for these algorithms.
> 
> Fixes: d9b7d5bbc845 ("crypto/qat: add ZUC EEA3/EIA3 capability")
> Cc: arkadiuszx.kusztal@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
Applied to dpdk-next-crypto

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-04 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 14:05 [PATCH] crypto/qat: fix stream cipher direction Ciara Power
2023-01-04 11:52 ` [EXT] " Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).