[PATCH 1/3] cryptodev: add SHAKE algorithm

Volodymyr Fialko vfialko at marvell.com
Wed Jan 4 15:38:13 CET 2023


Add SHAKE to enum of auth algorithms.

Signed-off-by: Volodymyr Fialko <vfialko at 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(-)

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",
 };
 
 /**
-- 
2.34.1



More information about the dev mailing list