From patchwork Wed Sep 28 13:18:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 117063 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3F3E6A00C4; Wed, 28 Sep 2022 16:27:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 852F74280C; Wed, 28 Sep 2022 16:27:17 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id CF9734113C for ; Wed, 28 Sep 2022 16:27:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664375236; x=1695911236; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=lNIC2AIMs+2ETCArIjtA5AOzqy06B5EQSwYoX56lNrc=; b=gEPsjPqWYc+po9Ta6QrnpkmjhcvhD8Jodb3/H/PKeYzQAmcZvRGMTSUq Wz/2J2XbsnbvCXlx+8WrygdNhLt+Zjyzdbord7vxcE9wKqvUW3kfP1V+V 00uvfCclVrCrdardg/96DsoqF+OyybPexjOZiVj9nROzhLKlGUd9SShDG J8a3us0fE6VQjIdhQpUUtMN6bxcmJ89f/MtAoZ4AYT9KhroIStC9zah5j ITNTv/XDcgi3xfGXfsRs2kM54ESYGgy6ESSEDMrqvRcEI17s1CPNX52bB pZSPY3KmuZCJhZpzxVe+XNk+7Xa0DTbUyBCiDSrGSt2qa+nl9W5wKcxGG w==; X-IronPort-AV: E=McAfee;i="6500,9779,10484"; a="281331406" X-IronPort-AV: E=Sophos;i="5.93,352,1654585200"; d="scan'208";a="281331406" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2022 07:27:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10484"; a="684425698" X-IronPort-AV: E=Sophos;i="5.93,352,1654585200"; d="scan'208";a="684425698" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by fmsmga008.fm.intel.com with ESMTP; 28 Sep 2022 07:27:10 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, kai.ji@intel.com, Arek Kusztal Subject: [PATCH v2 2/2] cryptodev: add sm3 hash algorithm Date: Wed, 28 Sep 2022 14:18:01 +0100 Message-Id: <20220928131801.64467-3-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220928131801.64467-1-arkadiuszx.kusztal@intel.com> References: <20220928131801.64467-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 ShangMi 3 (SM3) is a cryptographic hash function used in the Chinese National Standard. - Added SM3 algorithm Signed-off-by: Arek Kusztal Acked-by: Kai Ji --- 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" }; /**