Added support for symmetric algorithm SM4 GCM in cryptodev.

Signed-off-by: Brian Dooley <brian.doo...@intel.com>
---
 doc/guides/cryptodevs/features/default.ini | 2 ++
 lib/cryptodev/rte_crypto_sym.h             | 4 +++-
 lib/cryptodev/rte_cryptodev.c              | 3 ++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/doc/guides/cryptodevs/features/default.ini 
b/doc/guides/cryptodevs/features/default.ini
index 592af48026..116ffce249 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -118,6 +118,8 @@ AES CCM (128)     =
 AES CCM (192)     =
 AES CCM (256)     =
 CHACHA20-POLY1305 =
+SM4 GCM           =
+
 ;
 ; Supported Asymmetric algorithms of a default crypto driver.
 ;
diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index 505356ff44..b47e52f63b 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -482,8 +482,10 @@ enum rte_crypto_aead_algorithm {
        /**< AES algorithm in CCM mode. */
        RTE_CRYPTO_AEAD_AES_GCM,
        /**< AES algorithm in GCM mode. */
-       RTE_CRYPTO_AEAD_CHACHA20_POLY1305
+       RTE_CRYPTO_AEAD_CHACHA20_POLY1305,
        /**< Chacha20 cipher with poly1305 authenticator */
+       RTE_CRYPTO_AEAD_SM4_GCM
+       /**< SM4 cipher with GCM mode */
 };
 
 /** Symmetric AEAD Operations */
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index a49b0662f3..7b5236ad41 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -168,7 +168,8 @@ static const char *
 crypto_aead_algorithm_strings[] = {
        [RTE_CRYPTO_AEAD_AES_CCM]       = "aes-ccm",
        [RTE_CRYPTO_AEAD_AES_GCM]       = "aes-gcm",
-       [RTE_CRYPTO_AEAD_CHACHA20_POLY1305] = "chacha20-poly1305"
+       [RTE_CRYPTO_AEAD_CHACHA20_POLY1305] = "chacha20-poly1305",
+       [RTE_CRYPTO_AEAD_SM4_GCM]   = "sm4-gcm"
 };
 
 
-- 
2.25.1

Reply via email to