From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 465B5A0032; Wed, 17 Aug 2022 09:17:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53365415D7; Wed, 17 Aug 2022 09:17:50 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 111A94113C for ; Wed, 17 Aug 2022 09:17:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660720669; x=1692256669; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=P42+X2ZB5/uCwnlWQZKRqyxi8o4amtPc4RiL8jPm5Rw=; b=HjXhlhR9pAy2yPXxwqU02dEkS+uFGVUQGMDPjA0vM6Q3ZiUptDo7wcuo giJ5MoFV9hwk4uj8ajHW4kyAXojvNHSphycqWgJdgq6QmcPF1IO6W6eq2 Z48zR6f7cxVjMolTuJuZhFB26Ye+nBYzgVbTtJRCKMYTNoHEI/7ZWGa7H xH4uUHZNDvhM+h4VS2g+qkEFIr3WmKa9KkgaKDlj+7AXTd8h2zuk3JGUo pSoYcH/H5sOkTd+f1VPD50nZVCvi/+zaN/9ZUfwup8Mf6Aq3xCY1DcX6j mp7gUaFtdEYqmi2lpgooJNYUvK1LC9ff/Ic0Q+thtnIiFbiWbR4UAMZcb g==; X-IronPort-AV: E=McAfee;i="6400,9594,10441"; a="356421125" X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="356421125" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2022 00:17:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="667485785" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by fmsmga008.fm.intel.com with ESMTP; 17 Aug 2022 00:17:47 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, kai.ji@intel.com, Arek Kusztal Subject: [PATCH 2/4] cryptodev: add SM3 hash algorithm Date: Wed, 17 Aug 2022 07:08:54 +0100 Message-Id: <20220817060856.78582-3-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220817060856.78582-1-arkadiuszx.kusztal@intel.com> References: <20220817060856.78582-1-arkadiuszx.kusztal@intel.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org SM3 is a cryptographic hash function used in the Chinese National Standard. - Added SM3 algorithm Signed-off-by: Arek Kusztal --- 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 15fc6ec40a..0609652b07 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -60,6 +60,11 @@ New Features Added SM4 encryption algorithm to the Cryptodev API. Supported modes are ECB, CBC and CTR. +* **Added SM3 hash algorithm.** + + Added SM3 hash algorithm to the Cryptodev API. + + Removed Items ------------- diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h index 33420e0b36..1b07e832c3 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 + /**< SM3 algorithm */ }; /** Authentication algorithm name strings */ diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 266804f0fe..2b6c7de930 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -135,7 +135,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] = "zuc-sm3" }; /** -- 2.13.6