Skip to contentSkip to conversation

crypto/qat: add SHA3 plain hash support

PATCH Applied Ciara Power 3 participants 3 messages Dec 14, 2022 – Jan 4, 2023 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/qat: add SHA3 plain hash support

Add support for plain SHA3-224, SHA3-256,
SHA3-384, and SHA3-512 hash support in QAT GEN3.
Add support for SHA3-256 in GEN2.

---
Tested using testcases from patch not yet merged.
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

---
 doc/guides/cryptodevs/features/qat.ini       |  4 ++
 doc/guides/cryptodevs/qat.rst                |  4 ++
 doc/guides/rel_notes/release_23_03.rst       |  4 ++
 drivers/common/qat/qat_adf/icp_qat_hw.h      |  4 +-
 drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c |  3 +
 drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 12 ++++
 drivers/crypto/qat/qat_sym_session.c         | 60 ++++++++++++++++++++
 7 files changed, 89 insertions(+), 2 deletions(-)
doc/guides/cryptodevs/features/qat.ini +4 -0
index 5ba5546160..70511a3076 100644
@@ -59,6 +59,10 @@ SHA384       = Y
 SHA384 HMAC  = Y
 SHA512       = Y
 SHA512 HMAC  = Y
+SHA3_224     = Y
+SHA3_256     = Y
+SHA3_384     = Y
+SHA3_512     = Y
 AES GMAC     = Y
 SNOW3G UIA2  = Y
 KASUMI F9    = Y
doc/guides/cryptodevs/qat.rst +4 -0
index d1e64475c4..7bd85df2cc 100644
@@ -64,6 +64,10 @@ Hash algorithms:
 * ``RTE_CRYPTO_AUTH_SHA384_HMAC``
 * ``RTE_CRYPTO_AUTH_SHA512``
 * ``RTE_CRYPTO_AUTH_SHA512_HMAC``
+* ``RTE_CRYPTO_AUTH_SHA3_224``
+* ``RTE_CRYPTO_AUTH_SHA3_256``
+* ``RTE_CRYPTO_AUTH_SHA3_384``
+* ``RTE_CRYPTO_AUTH_SHA3_512``
 * ``RTE_CRYPTO_AUTH_AES_XCBC_MAC``
 * ``RTE_CRYPTO_AUTH_SNOW3G_UIA2``
 * ``RTE_CRYPTO_AUTH_MD5_HMAC``
doc/guides/rel_notes/release_23_03.rst +4 -0
index b8c5b68d6c..ac2eafc7ea 100644
@@ -55,6 +55,10 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Updated Intel QuickAssist Technology (QAT) crypto driver.**
+
+  * Added support for SHA3 224/256/384/512 Plain Hash in QAT GEN 3.
+  * Added support for SHA3 256 Plain Hash in QAT GEN 2.
 
 Removed Items
 -------------
drivers/common/qat/qat_adf/icp_qat_hw.h +2 -2
index 5c420494ac..866147cd77 100644
@@ -65,9 +65,9 @@ enum icp_qat_hw_auth_algo {
 	ICP_QAT_HW_AUTH_ALGO_SNOW_3G_UIA2 = 13,
 	ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3 = 14,
 	ICP_QAT_HW_AUTH_ALGO_SM3 = 15,
-	ICP_QAT_HW_AUTH_RESERVED_2 = 16,
+	ICP_QAT_HW_AUTH_ALGO_SHA3_224 = 16,
 	ICP_QAT_HW_AUTH_ALGO_SHA3_256 = 17,
-	ICP_QAT_HW_AUTH_RESERVED_3 = 18,
+	ICP_QAT_HW_AUTH_ALGO_SHA3_384 = 18,
 	ICP_QAT_HW_AUTH_ALGO_SHA3_512 = 19,
 	ICP_QAT_HW_AUTH_ALGO_DELIMITER = 20
 };
drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c +3 -0
index 3d01fa7770..60ca0fc0d2 100644
@@ -48,6 +48,9 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen2[] = {
 		CAP_SET(block_size, 128),
 		CAP_RNG_ZERO(key_size), CAP_RNG(digest_size, 1, 64, 1),
 		CAP_RNG_ZERO(aad_size), CAP_RNG_ZERO(iv_size)),
+	QAT_SYM_PLAIN_AUTH_CAP(SHA3_256,
+		CAP_SET(block_size, 136),
+		CAP_RNG(digest_size, 32, 32, 0)),
 	QAT_SYM_AUTH_CAP(SHA1_HMAC,
 		CAP_SET(block_size, 64),
 		CAP_RNG(key_size, 1, 64, 1), CAP_RNG(digest_size, 1, 20, 1),
drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c +12 -0
index 7f00f6097d..9bb0524db1 100644
@@ -46,6 +46,18 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen3[] = {
 		CAP_SET(block_size, 128),
 		CAP_RNG_ZERO(key_size), CAP_RNG(digest_size, 1, 64, 1),
 		CAP_RNG_ZERO(aad_size), CAP_RNG_ZERO(iv_size)),
+	QAT_SYM_PLAIN_AUTH_CAP(SHA3_224,
+		CAP_SET(block_size, 144),
+		CAP_RNG(digest_size, 28, 28, 0)),
+	QAT_SYM_PLAIN_AUTH_CAP(SHA3_256,
+		CAP_SET(block_size, 136),
+		CAP_RNG(digest_size, 32, 32, 0)),
+	QAT_SYM_PLAIN_AUTH_CAP(SHA3_384,
+		CAP_SET(block_size, 104),
+		CAP_RNG(digest_size, 48, 48, 0)),
+	QAT_SYM_PLAIN_AUTH_CAP(SHA3_512,
+		CAP_SET(block_size, 72),
+		CAP_RNG(digest_size, 64, 64, 0)),
 	QAT_SYM_AUTH_CAP(SHA1_HMAC,
 		CAP_SET(block_size, 64),
 		CAP_RNG(key_size, 1, 64, 1), CAP_RNG(digest_size, 1, 20, 1),
drivers/crypto/qat/qat_sym_session.c +60 -0

84 lines not on this page · raw message

Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Ciara Power

Add support for plain SHA3-224, SHA3-256,
SHA3-384, and SHA3-512 hash support in QAT GEN3.
Add support for SHA3-256 in GEN2.

---
Tested using testcases from patch not yet merged.
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

Quoted 9 lines
---
  doc/guides/cryptodevs/features/qat.ini       |  4 ++
  doc/guides/cryptodevs/qat.rst                |  4 ++
  doc/guides/rel_notes/release_23_03.rst       |  4 ++
  drivers/common/qat/qat_adf/icp_qat_hw.h      |  4 +-
  drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c |  3 +
  drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 12 ++++
  drivers/crypto/qat/qat_sym_session.c         | 60 ++++++++++++++++++++
  7 files changed, 89 insertions(+), 2 deletions(-)
Applied
#2 lore raw
Quoted 20 lines · Ciara Power
Quoted 10 lines

Add support for plain SHA3-224, SHA3-256,
SHA3-384, and SHA3-512 hash support in QAT GEN3.
Add support for SHA3-256 in GEN2.

---
Tested using testcases from patch not yet merged.
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

Quoted 9 lines
---
  doc/guides/cryptodevs/features/qat.ini       |  4 ++
  doc/guides/cryptodevs/qat.rst                |  4 ++
  doc/guides/rel_notes/release_23_03.rst       |  4 ++
  drivers/common/qat/qat_adf/icp_qat_hw.h      |  4 +-
  drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c |  3 +
  drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 12 ++++
  drivers/crypto/qat/qat_sym_session.c         | 60 ++++++++++++++++++++
  7 files changed, 89 insertions(+), 2 deletions(-)
Quoted 1 line

Applied to dpdk-next-crypto

Thanks.