* [PATCH v2 1/2] cryptodev: add sm4 encryption algorithm
2022-09-28 13:17 [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms Arek Kusztal
@ 2022-09-28 13:18 ` Arek Kusztal
2022-09-28 15:26 ` Ji, Kai
2022-09-28 13:18 ` [PATCH v2 2/2] cryptodev: add sm3 hash algorithm Arek Kusztal
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Arek Kusztal @ 2022-09-28 13:18 UTC (permalink / raw)
To: dev; +Cc: gakhil, kai.ji, Arek Kusztal
ShangMi 4 (SM4) is a block cipher used in the Chinese National Standard for
Wireless LAN WAPI and also used with Transport Layer Security.
- Added SM4 encryption algorithm.
Supported modes are ECB, CBC and CTR.
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
doc/guides/cryptodevs/features/default.ini | 3 +++
doc/guides/rel_notes/release_22_11.rst | 4 ++++
lib/cryptodev/rte_crypto_sym.h | 9 ++++++++-
lib/cryptodev/rte_cryptodev.c | 5 ++++-
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index 7371ca6644..1608426b12 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -61,6 +61,9 @@ DES DOCSIS BPI =
SNOW3G UEA2 =
KASUMI F8 =
ZUC EEA3 =
+SM4 ECB =
+SM4 CBC =
+SM4 CTR =
;
; Supported authentication algorithms of a default crypto driver.
diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
index 510485017d..e8113ee056 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -80,6 +80,10 @@ New Features
* Added ``rte_event_eth_tx_adapter_instance_get`` to get Tx adapter
instance ID for specified ethernet device ID and Tx queue index.
+* **Added ShangMi 4 (SM4) encryption algorithm in ECB, CBC and CTR mode to the cryptodev.**
+
+ Added ``RTE_CRYPTO_CIPHER_SM4_ECB``, ``RTE_CRYPTO_CIPHER_SM4_CBC``,
+ ``RTE_CRYPTO_CIPHER_SM4_CTR`` to the cipher algorithm list in the cryptodev.
Removed Items
-------------
diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index daa090b978..613950993a 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -160,12 +160,19 @@ enum rte_crypto_cipher_algorithm {
* for m_src and m_dst in the rte_crypto_sym_op must be NULL.
*/
- RTE_CRYPTO_CIPHER_DES_DOCSISBPI
+ RTE_CRYPTO_CIPHER_DES_DOCSISBPI,
/**< DES algorithm using modes required by
* DOCSIS Baseline Privacy Plus Spec.
* Chained mbufs are not supported in this mode, i.e. rte_mbuf.next
* for m_src and m_dst in the rte_crypto_sym_op must be NULL.
*/
+
+ RTE_CRYPTO_CIPHER_SM4_ECB,
+ /**< ShangMi 4 (SM4) algorithm in ECB mode */
+ RTE_CRYPTO_CIPHER_SM4_CBC,
+ /**< ShangMi 4 (SM4) algorithm in CBC mode */
+ RTE_CRYPTO_CIPHER_SM4_CTR
+ /**< ShangMi 4 (SM4) algorithm in CTR mode */
};
/** Cipher algorithm name strings */
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 5e25e607fa..5622c5a735 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -89,7 +89,10 @@ rte_crypto_cipher_algorithm_strings[] = {
[RTE_CRYPTO_CIPHER_KASUMI_F8] = "kasumi-f8",
[RTE_CRYPTO_CIPHER_SNOW3G_UEA2] = "snow3g-uea2",
- [RTE_CRYPTO_CIPHER_ZUC_EEA3] = "zuc-eea3"
+ [RTE_CRYPTO_CIPHER_ZUC_EEA3] = "zuc-eea3",
+ [RTE_CRYPTO_CIPHER_SM4_ECB] = "sm4-ecb",
+ [RTE_CRYPTO_CIPHER_SM4_CBC] = "sm4-cbc",
+ [RTE_CRYPTO_CIPHER_SM4_CTR] = "sm4-ctr"
};
/**
--
2.13.6
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH v2 1/2] cryptodev: add sm4 encryption algorithm
2022-09-28 13:18 ` [PATCH v2 1/2] cryptodev: add sm4 encryption algorithm Arek Kusztal
@ 2022-09-28 15:26 ` Ji, Kai
0 siblings, 0 replies; 10+ messages in thread
From: Ji, Kai @ 2022-09-28 15:26 UTC (permalink / raw)
To: Kusztal, ArkadiuszX, dev; +Cc: gakhil, Ji, Kai
Acked-by: Kai Ji <kai.ji@intel.com>
> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Wednesday, September 28, 2022 2:18 PM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Ji, Kai <kai.ji@intel.com>; Kusztal, ArkadiuszX
> <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH v2 1/2] cryptodev: add sm4 encryption algorithm
>
> ShangMi 4 (SM4) is a block cipher used in the Chinese National Standard for
> Wireless LAN WAPI and also used with Transport Layer Security.
>
> - Added SM4 encryption algorithm.
> Supported modes are ECB, CBC and CTR.
>
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 2/2] cryptodev: add sm3 hash algorithm
2022-09-28 13:17 [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms Arek Kusztal
2022-09-28 13:18 ` [PATCH v2 1/2] cryptodev: add sm4 encryption algorithm Arek Kusztal
@ 2022-09-28 13:18 ` Arek Kusztal
2022-09-28 15:27 ` Ji, Kai
2022-09-28 15:29 ` [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms Anoob Joseph
2022-09-29 19:24 ` Akhil Goyal
3 siblings, 1 reply; 10+ messages in thread
From: Arek Kusztal @ 2022-09-28 13:18 UTC (permalink / raw)
To: dev; +Cc: gakhil, kai.ji, Arek Kusztal
ShangMi 3 (SM3) is a cryptographic hash function used in
the Chinese National Standard.
- Added SM3 algorithm
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
doc/guides/cryptodevs/features/default.ini | 1 +
doc/guides/rel_notes/release_22_11.rst | 5 +++++
lib/cryptodev/rte_crypto_sym.h | 4 +++-
lib/cryptodev/rte_cryptodev.c | 3 ++-
4 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index 1608426b12..d51d80ff80 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -98,6 +98,7 @@ SHA3_384 =
SHA3_384 HMAC =
SHA3_512 =
SHA3_512 HMAC =
+SM3 =
;
; Supported AEAD algorithms of a default crypto driver.
diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
index e8113ee056..c0ae4e5608 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -85,6 +85,11 @@ New Features
Added ``RTE_CRYPTO_CIPHER_SM4_ECB``, ``RTE_CRYPTO_CIPHER_SM4_CBC``,
``RTE_CRYPTO_CIPHER_SM4_CTR`` to the cipher algorithm list in the cryptodev.
+* **Added ShangMi 3 (SM3) hash algorithm to the cryptodev.**
+
+ Added ``RTE_CRYPTO_AUTH_SM3`` to the auth algorithm list in the cryptodev.
+
+
Removed Items
-------------
diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index 613950993a..5b3c210837 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -370,8 +370,10 @@ enum rte_crypto_auth_algorithm {
/**< HMAC using 384 bit SHA3 algorithm. */
RTE_CRYPTO_AUTH_SHA3_512,
/**< 512 bit SHA3 algorithm. */
- RTE_CRYPTO_AUTH_SHA3_512_HMAC
+ RTE_CRYPTO_AUTH_SHA3_512_HMAC,
/**< HMAC using 512 bit SHA3 algorithm. */
+ RTE_CRYPTO_AUTH_SM3
+ /**< ShangMi 3 (SM3) algorithm */
};
/** Authentication algorithm name strings */
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 5622c5a735..0c57e73a29 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -144,7 +144,8 @@ rte_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_ZUC_EIA3] = "zuc-eia3",
+ [RTE_CRYPTO_AUTH_SM3] = "sm3"
};
/**
--
2.13.6
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH v2 2/2] cryptodev: add sm3 hash algorithm
2022-09-28 13:18 ` [PATCH v2 2/2] cryptodev: add sm3 hash algorithm Arek Kusztal
@ 2022-09-28 15:27 ` Ji, Kai
0 siblings, 0 replies; 10+ messages in thread
From: Ji, Kai @ 2022-09-28 15:27 UTC (permalink / raw)
To: Kusztal, ArkadiuszX, dev; +Cc: gakhil
Acked-by: Kai Ji <kai.ji@intel.com>
> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Wednesday, September 28, 2022 2:18 PM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Ji, Kai <kai.ji@intel.com>; Kusztal, ArkadiuszX
> <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH v2 2/2] cryptodev: add sm3 hash algorithm
>
> ShangMi 3 (SM3) is a cryptographic hash function used in the Chinese
> National Standard.
>
> - Added SM3 algorithm
>
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms
2022-09-28 13:17 [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms Arek Kusztal
2022-09-28 13:18 ` [PATCH v2 1/2] cryptodev: add sm4 encryption algorithm Arek Kusztal
2022-09-28 13:18 ` [PATCH v2 2/2] cryptodev: add sm3 hash algorithm Arek Kusztal
@ 2022-09-28 15:29 ` Anoob Joseph
2022-09-29 19:24 ` Akhil Goyal
3 siblings, 0 replies; 10+ messages in thread
From: Anoob Joseph @ 2022-09-28 15:29 UTC (permalink / raw)
To: Arek Kusztal, dev; +Cc: Akhil Goyal, kai.ji
> -----Original Message-----
> From: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> Sent: Wednesday, September 28, 2022 6:48 PM
> To: dev@dpdk.org
> Cc: Akhil Goyal <gakhil@marvell.com>; kai.ji@intel.com; Arek Kusztal
> <arkadiuszx.kusztal@intel.com>
> Subject: [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms
>
> External Email
>
> ----------------------------------------------------------------------
> ShangMi 4 (SM4) is a block cipher used in the Chinese National Standard for
> Wireless LAN WAPI and also used with Transport Layer Security.
> ShangMi 3 (SM3) is a cryptographic hash function used in the Chinese
> National Standard.
>
> This patcheset adds both to the Cryptodev.
>
> v2:
> - Fixed incorrect sm3 string
> - Added full name of the algorithm
>
> Arek Kusztal (2):
> cryptodev: add sm4 encryption algorithm
> cryptodev: add sm3 hash algorithm
>
> doc/guides/cryptodevs/features/default.ini | 4 ++++
> doc/guides/rel_notes/release_22_11.rst | 9 +++++++++
> lib/cryptodev/rte_crypto_sym.h | 13 +++++++++++--
> lib/cryptodev/rte_cryptodev.c | 8 ++++++--
> 4 files changed, 30 insertions(+), 4 deletions(-)
>
> --
> 2.13.6
Series Acked-by: Anoob Joseph <anoobj@marvell.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms
2022-09-28 13:17 [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms Arek Kusztal
` (2 preceding siblings ...)
2022-09-28 15:29 ` [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms Anoob Joseph
@ 2022-09-29 19:24 ` Akhil Goyal
2022-09-30 8:35 ` Kusztal, ArkadiuszX
3 siblings, 1 reply; 10+ messages in thread
From: Akhil Goyal @ 2022-09-29 19:24 UTC (permalink / raw)
To: Arek Kusztal, dev; +Cc: kai.ji
> ShangMi 4 (SM4) is a block cipher used in the Chinese National Standard for
> Wireless LAN WAPI and also used with Transport Layer Security.
> ShangMi 3 (SM3) is a cryptographic hash function used in the
> Chinese National Standard.
>
> This patcheset adds both to the Cryptodev.
>
> v2:
> - Fixed incorrect sm3 string
> - Added full name of the algorithm
>
> Arek Kusztal (2):
> cryptodev: add sm4 encryption algorithm
> cryptodev: add sm3 hash algorithm
>
> doc/guides/cryptodevs/features/default.ini | 4 ++++
> doc/guides/rel_notes/release_22_11.rst | 9 +++++++++
> lib/cryptodev/rte_crypto_sym.h | 13 +++++++++++--
> lib/cryptodev/rte_cryptodev.c | 8 ++++++--
> 4 files changed, 30 insertions(+), 4 deletions(-)
>
Hi Arek,
Why are the QAT implementation patches removed from this series?
We cannot simply add enums which are not being used anywhere.
Regards,
Akhil
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms
2022-09-29 19:24 ` Akhil Goyal
@ 2022-09-30 8:35 ` Kusztal, ArkadiuszX
2022-09-30 8:39 ` Akhil Goyal
2022-09-30 17:43 ` Akhil Goyal
0 siblings, 2 replies; 10+ messages in thread
From: Kusztal, ArkadiuszX @ 2022-09-30 8:35 UTC (permalink / raw)
To: Akhil Goyal, dev; +Cc: Ji, Kai
> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Thursday, September 29, 2022 9:25 PM
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> Cc: Ji, Kai <kai.ji@intel.com>
> Subject: RE: [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms
>
> > ShangMi 4 (SM4) is a block cipher used in the Chinese National
> > Standard for Wireless LAN WAPI and also used with Transport Layer Security.
> > ShangMi 3 (SM3) is a cryptographic hash function used in the Chinese
> > National Standard.
> >
> > This patcheset adds both to the Cryptodev.
> >
> > v2:
> > - Fixed incorrect sm3 string
> > - Added full name of the algorithm
> >
> > Arek Kusztal (2):
> > cryptodev: add sm4 encryption algorithm
> > cryptodev: add sm3 hash algorithm
> >
> > doc/guides/cryptodevs/features/default.ini | 4 ++++
> > doc/guides/rel_notes/release_22_11.rst | 9 +++++++++
> > lib/cryptodev/rte_crypto_sym.h | 13 +++++++++++--
> > lib/cryptodev/rte_cryptodev.c | 8 ++++++--
> > 4 files changed, 30 insertions(+), 4 deletions(-)
> >
> Hi Arek,
>
> Why are the QAT implementation patches removed from this series?
> We cannot simply add enums which are not being used anywhere.
I wanted to push qat patches and tests to rc2. I this option cannot be accepted I will send v3 with qat patches before rc1 deadline.
>
> Regards,
> Akhil
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms
2022-09-30 8:35 ` Kusztal, ArkadiuszX
@ 2022-09-30 8:39 ` Akhil Goyal
2022-09-30 17:43 ` Akhil Goyal
1 sibling, 0 replies; 10+ messages in thread
From: Akhil Goyal @ 2022-09-30 8:39 UTC (permalink / raw)
To: Kusztal, ArkadiuszX, dev; +Cc: Ji, Kai
> > > ShangMi 4 (SM4) is a block cipher used in the Chinese National
> > > Standard for Wireless LAN WAPI and also used with Transport Layer Security.
> > > ShangMi 3 (SM3) is a cryptographic hash function used in the Chinese
> > > National Standard.
> > >
> > > This patcheset adds both to the Cryptodev.
> > >
> > > v2:
> > > - Fixed incorrect sm3 string
> > > - Added full name of the algorithm
> > >
> > > Arek Kusztal (2):
> > > cryptodev: add sm4 encryption algorithm
> > > cryptodev: add sm3 hash algorithm
> > >
> > > doc/guides/cryptodevs/features/default.ini | 4 ++++
> > > doc/guides/rel_notes/release_22_11.rst | 9 +++++++++
> > > lib/cryptodev/rte_crypto_sym.h | 13 +++++++++++--
> > > lib/cryptodev/rte_cryptodev.c | 8 ++++++--
> > > 4 files changed, 30 insertions(+), 4 deletions(-)
> > >
> > Hi Arek,
> >
> > Why are the QAT implementation patches removed from this series?
> > We cannot simply add enums which are not being used anywhere.
> I wanted to push qat patches and tests to rc2. I this option cannot be accepted I
> will send v3 with qat patches before rc1 deadline.
We can take the QAT patches in RC2. But atleast we should have plans for the implementation to be merged.
I will merge the patches today. Please make sure the implementation is applied in RC2.
Regards,
Akhil
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms
2022-09-30 8:35 ` Kusztal, ArkadiuszX
2022-09-30 8:39 ` Akhil Goyal
@ 2022-09-30 17:43 ` Akhil Goyal
1 sibling, 0 replies; 10+ messages in thread
From: Akhil Goyal @ 2022-09-30 17:43 UTC (permalink / raw)
To: Kusztal, ArkadiuszX, dev; +Cc: Ji, Kai
> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Friday, September 30, 2022 2:06 PM
> To: Akhil Goyal <gakhil@marvell.com>; dev@dpdk.org
> Cc: Ji, Kai <kai.ji@intel.com>
> Subject: RE: [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms
>
>
>
> > -----Original Message-----
> > From: Akhil Goyal <gakhil@marvell.com>
> > Sent: Thursday, September 29, 2022 9:25 PM
> > To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> > Cc: Ji, Kai <kai.ji@intel.com>
> > Subject: RE: [EXT] [PATCH v2 0/2] cryptodev: add SM3 and SM4 algorithms
> >
> > > ShangMi 4 (SM4) is a block cipher used in the Chinese National
> > > Standard for Wireless LAN WAPI and also used with Transport Layer Security.
> > > ShangMi 3 (SM3) is a cryptographic hash function used in the Chinese
> > > National Standard.
> > >
> > > This patcheset adds both to the Cryptodev.
> > >
> > > v2:
> > > - Fixed incorrect sm3 string
> > > - Added full name of the algorithm
> > >
> > > Arek Kusztal (2):
> > > cryptodev: add sm4 encryption algorithm
> > > cryptodev: add sm3 hash algorithm
> > >
> > > doc/guides/cryptodevs/features/default.ini | 4 ++++
> > > doc/guides/rel_notes/release_22_11.rst | 9 +++++++++
> > > lib/cryptodev/rte_crypto_sym.h | 13 +++++++++++--
> > > lib/cryptodev/rte_cryptodev.c | 8 ++++++--
> > > 4 files changed, 30 insertions(+), 4 deletions(-)
> > >
> > Hi Arek,
> >
> > Why are the QAT implementation patches removed from this series?
> > We cannot simply add enums which are not being used anywhere.
> I wanted to push qat patches and tests to rc2. I this option cannot be accepted I
> will send v3 with qat patches before rc1 deadline.
> >
This series along with PMD changes applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread