[v3,1/3] crypto/ipsec_mb: add SM3 algorithm support
Checks
Commit Message
This patch introduces SM3 algorithm support to the AESNI_MB PMD.
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
v3:
Add ipsec mb version check
Add documentation
---
doc/guides/cryptodevs/aesni_mb.rst | 1 +
doc/guides/cryptodevs/features/aesni_mb.ini | 1 +
doc/guides/rel_notes/release_24_11.rst | 3 +++
drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 5 ++++
drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 28 ++++++++++++++++++++-
5 files changed, 37 insertions(+), 1 deletion(-)
Comments
> -----Original Message-----
> From: Dooley, Brian <brian.dooley@intel.com>
> Sent: Thursday, October 3, 2024 6:05 PM
> To: Ji, Kai <kai.ji@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; gakhil@marvell.com; Dooley, Brian
> <brian.dooley@intel.com>
> Subject: [PATCH v3 1/3] crypto/ipsec_mb: add SM3 algorithm support
>
> This patch introduces SM3 algorithm support to the AESNI_MB PMD.
>
> Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> > -----Original Message-----
> > From: Dooley, Brian <brian.dooley@intel.com>
> > Sent: Thursday, October 3, 2024 6:05 PM
> > To: Ji, Kai <kai.ji@intel.com>; De Lara Guarch, Pablo
> > <pablo.de.lara.guarch@intel.com>
> > Cc: dev@dpdk.org; gakhil@marvell.com; Dooley, Brian
> > <brian.dooley@intel.com>
> > Subject: [PATCH v3 1/3] crypto/ipsec_mb: add SM3 algorithm support
> >
> > This patch introduces SM3 algorithm support to the AESNI_MB PMD.
> >
> > Signed-off-by: Brian Dooley <brian.dooley@intel.com>
>
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Series applied to dpdk-next-crypto
Thanks.
@@ -56,6 +56,7 @@ Hash algorithms:
* RTE_CRYPTO_AUTH_ZUC_EIA3
* RTE_CRYPTO_AUTH_SNOW3G_UIA2
* RTE_CRYPTO_AUTH_KASUMI_F9
+* RTE_CRYPTO_AUTH_SM3
AEAD algorithms:
@@ -64,6 +64,7 @@ AES GMAC = Y
ZUC EIA3 = Y
SNOW3G UIA2 = Y
KASUMI F9 = Y
+SM3 = Y
;
; Supported AEAD algorithms of the 'aesni_mb' crypto driver.
@@ -55,6 +55,9 @@ New Features
Also, make sure to start the actual text at the margin.
=======================================================
+* **Updated IPsec_MB crypto driver.**
+ * Added support for SM3 algorithm.
+
Removed Items
-------------
@@ -377,6 +377,11 @@ aesni_mb_set_session_auth_parameters(IMB_MGR *mb_mgr,
sess->template_job.hash_alg = IMB_AUTH_SHA_512;
auth_precompute = 0;
break;
+#if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM
+ case RTE_CRYPTO_AUTH_SM3:
+ sess->template_job.hash_alg = IMB_AUTH_SM3;
+ break;
+#endif
default:
IPSEC_MB_LOG(ERR,
"Unsupported authentication algorithm selection");
@@ -732,6 +732,29 @@ static const struct rte_cryptodev_capabilities aesni_mb_capabilities[] = {
}, }
}, }
},
+#if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM
+ { /* SM3 */
+ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+ {.sym = {
+ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+ {.auth = {
+ .algo = RTE_CRYPTO_AUTH_SM3,
+ .block_size = 64,
+ .key_size = {
+ .min = 0,
+ .max = 0,
+ .increment = 0
+ },
+ .digest_size = {
+ .min = 32,
+ .max = 32,
+ .increment = 1
+ },
+ .iv_size = { 0 }
+ }, }
+ }, }
+ },
+#endif
RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};
@@ -840,7 +863,10 @@ static const unsigned int auth_digest_byte_lengths[] = {
[IMB_AUTH_SHA_512] = 64,
[IMB_AUTH_ZUC_EIA3_BITLEN] = 4,
[IMB_AUTH_SNOW3G_UIA2_BITLEN] = 4,
- [IMB_AUTH_KASUMI_UIA1] = 4
+ [IMB_AUTH_KASUMI_UIA1] = 4,
+#if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM
+ [IMB_AUTH_SM3] = 32
+#endif
/**< Vector mode dependent pointer table of the multi-buffer APIs */
};