[v2,1/3] cryptodev: add SHAKE algorithm

Message ID 20230112104733.1835722-2-vfialko@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series Add support for SHAKE |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Volodymyr Fialko Jan. 12, 2023, 10:47 a.m. UTC
  Add SHAKE to enum of auth algorithms.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
 doc/guides/cryptodevs/features/default.ini | 2 ++
 lib/cryptodev/rte_crypto_sym.h             | 7 ++++++-
 lib/cryptodev/rte_cryptodev.c              | 5 ++++-
 3 files changed, 12 insertions(+), 2 deletions(-)
  

Comments

Akhil Goyal Jan. 30, 2023, 7:24 p.m. UTC | #1
> -----Original Message-----
> From: Volodymyr Fialko <vfialko@marvell.com>
> Sent: Thursday, January 12, 2023 4:18 PM
> To: dev@dpdk.org; Akhil Goyal <gakhil@marvell.com>; Fan Zhang
> <fanzhang.oss@gmail.com>
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>; Volodymyr Fialko <vfialko@marvell.com>
> Subject: [PATCH v2 1/3] cryptodev: add SHAKE algorithm
> 
> Add SHAKE to enum of auth algorithms.
> 
> Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
  

Patch

diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index d51d80ff80..523da0cfa8 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -99,6 +99,8 @@  SHA3_384 HMAC   =
 SHA3_512        =
 SHA3_512 HMAC   =
 SM3             =
+SHAKE_128       =
+SHAKE_256       =
 
 ;
 ; Supported AEAD algorithms of a default crypto driver.
diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index dc847da7b8..2cfe66530c 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -374,8 +374,13 @@  enum rte_crypto_auth_algorithm {
 	/**< 512 bit SHA3 algorithm. */
 	RTE_CRYPTO_AUTH_SHA3_512_HMAC,
 	/**< HMAC using 512 bit SHA3 algorithm. */
-	RTE_CRYPTO_AUTH_SM3
+	RTE_CRYPTO_AUTH_SM3,
 	/**< ShangMi 3 (SM3) algorithm */
+
+	RTE_CRYPTO_AUTH_SHAKE_128,
+	/**< 128 bit SHAKE algorithm. */
+	RTE_CRYPTO_AUTH_SHAKE_256,
+	/**< 256 bit SHAKE algorithm. */
 };
 
 /** Authentication algorithm name strings */
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 742a4c512e..17c70023ef 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -226,7 +226,10 @@  crypto_auth_algorithm_strings[] = {
 	[RTE_CRYPTO_AUTH_KASUMI_F9]	= "kasumi-f9",
 	[RTE_CRYPTO_AUTH_SNOW3G_UIA2]	= "snow3g-uia2",
 	[RTE_CRYPTO_AUTH_ZUC_EIA3]	= "zuc-eia3",
-	[RTE_CRYPTO_AUTH_SM3]		= "sm3"
+	[RTE_CRYPTO_AUTH_SM3]		= "sm3",
+
+	[RTE_CRYPTO_AUTH_SHAKE_128]	 = "shake-128",
+	[RTE_CRYPTO_AUTH_SHAKE_256]	 = "shake-256",
 };
 
 /**