From: Akhil Goyal <gakhil@marvell.com>
To: Sunyang Wu <sunyang.wu@jaguarmicro.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "kai.ji@intel.com" <kai.ji@intel.com>
Subject: RE: [EXT] [PATCH v3 1/2] cryptodev: support SM3_HMAC,SM4_CFB and SM4_OFB
Date: Fri, 26 May 2023 07:15:26 +0000 [thread overview]
Message-ID: <CO6PR18MB4484BF0C1F8C9E17227D8199D8479@CO6PR18MB4484.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20230526011811.3628-1-sunyang.wu@jaguarmicro.com>
> Add SM3_HMAC/SM4_CFB/SM4_OFB support in DPDK.
>
> Signed-off-by: Sunyang Wu <sunyang.wu@jaguarmicro.com>
> ---
> doc/guides/cryptodevs/features/default.ini | 3 +++
> doc/guides/rel_notes/release_23_07.rst | 5 +++++
> lib/cryptodev/rte_crypto_sym.h | 8 +++++++-
> 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 523da0cfa8..8f54d4a2a5 100644
> --- a/doc/guides/cryptodevs/features/default.ini
> +++ b/doc/guides/cryptodevs/features/default.ini
> @@ -64,6 +64,8 @@ ZUC EEA3 =
> SM4 ECB =
> SM4 CBC =
> SM4 CTR =
> +SM4 CFB =
> +SM4 OFB =
>
> ;
> ; Supported authentication algorithms of a default crypto driver.
> @@ -99,6 +101,7 @@ SHA3_384 HMAC =
> SHA3_512 =
> SHA3_512 HMAC =
> SM3 =
> +SM3 HMAC =
> SHAKE_128 =
> SHAKE_256 =
>
> diff --git a/doc/guides/rel_notes/release_23_07.rst
> b/doc/guides/rel_notes/release_23_07.rst
> index a9b1293689..405b34c6d2 100644
> --- a/doc/guides/rel_notes/release_23_07.rst
> +++ b/doc/guides/rel_notes/release_23_07.rst
> @@ -55,6 +55,11 @@ New Features
> Also, make sure to start the actual text at the margin.
> =======================================================
>
> +* **Added new algorithms to cryptodev.**
> +
> + * Added symmetric hash algorithm SM3-HMAC.
> + * Added symmetric cipher algorithm ShangMi 4 (SM4) in CFB and OFB modes.
> +
>
> Removed Items
> -------------
> diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
> index b43174dbec..428603d06e 100644
> --- a/lib/cryptodev/rte_crypto_sym.h
> +++ b/lib/cryptodev/rte_crypto_sym.h
> @@ -172,8 +172,12 @@ enum rte_crypto_cipher_algorithm {
> /**< ShangMi 4 (SM4) algorithm in ECB mode */
> RTE_CRYPTO_CIPHER_SM4_CBC,
> /**< ShangMi 4 (SM4) algorithm in CBC mode */
> - RTE_CRYPTO_CIPHER_SM4_CTR
> + RTE_CRYPTO_CIPHER_SM4_CTR,
> /**< ShangMi 4 (SM4) algorithm in CTR mode */
> + RTE_CRYPTO_CIPHER_SM4_OFB,
> + /**< ShangMi 4 (SM4) algorithm in OFB mode */
> + RTE_CRYPTO_CIPHER_SM4_CFB
> + /**< ShangMi 4 (SM4) algorithm in CFB mode */
> };
>
> /** Cipher algorithm name strings */
> @@ -376,6 +380,8 @@ enum rte_crypto_auth_algorithm {
> /**< HMAC using 512 bit SHA3 algorithm. */
> RTE_CRYPTO_AUTH_SM3,
> /**< ShangMi 3 (SM3) algorithm */
> + RTE_CRYPTO_AUTH_SM3_HMAC,
> + /** < HMAC using ShangMi 3 (SM3) algorithm */
You cannot insert in the middle of enum.
This will result in ABI break.
http://mails.dpdk.org/archives/test-report/2023-May/400475.html
Please move this change to end of enum for this release.
You can submit a patch for next release(which is an ABI break release.) to move it back.
>
> RTE_CRYPTO_AUTH_SHAKE_128,
> /**< 128 bit SHAKE algorithm. */
> diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
> index a96114b2da..4ff7046e97 100644
> --- a/lib/cryptodev/rte_cryptodev.c
> +++ b/lib/cryptodev/rte_cryptodev.c
> @@ -127,7 +127,9 @@ crypto_cipher_algorithm_strings[] = {
> [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"
> + [RTE_CRYPTO_CIPHER_SM4_CTR] = "sm4-ctr",
> + [RTE_CRYPTO_CIPHER_SM4_CFB] = "sm4-cfb",
> + [RTE_CRYPTO_CIPHER_SM4_OFB] = "sm4-ofb"
> };
>
> /**
> @@ -227,6 +229,7 @@ crypto_auth_algorithm_strings[] = {
> [RTE_CRYPTO_AUTH_SNOW3G_UIA2] = "snow3g-uia2",
> [RTE_CRYPTO_AUTH_ZUC_EIA3] = "zuc-eia3",
> [RTE_CRYPTO_AUTH_SM3] = "sm3",
> + [RTE_CRYPTO_AUTH_SM3_HMAC] = "sm3-hmac",
>
> [RTE_CRYPTO_AUTH_SHAKE_128] = "shake-128",
> [RTE_CRYPTO_AUTH_SHAKE_256] = "shake-256",
> --
> 2.19.0.rc0.windows.1
next prev parent reply other threads:[~2023-05-26 7:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 1:18 Sunyang Wu
2023-05-26 1:18 ` [PATCH v3 2/2] test/crypto: Add SM3/SM4 test vectors for verification in test app Sunyang Wu
2023-05-26 7:15 ` Akhil Goyal [this message]
2023-05-29 3:06 ` 回复: [EXT] [PATCH v3 1/2] cryptodev: support SM3_HMAC,SM4_CFB and SM4_OFB Sunyang Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CO6PR18MB4484BF0C1F8C9E17227D8199D8479@CO6PR18MB4484.namprd18.prod.outlook.com \
--to=gakhil@marvell.com \
--cc=dev@dpdk.org \
--cc=kai.ji@intel.com \
--cc=sunyang.wu@jaguarmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).