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 0AD2445AA2; Thu, 3 Oct 2024 19:05:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D5F24065D; Thu, 3 Oct 2024 19:05:39 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by mails.dpdk.org (Postfix) with ESMTP id 01A3440656 for ; Thu, 3 Oct 2024 19:05:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727975138; x=1759511138; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZjO/Y6izSYKzOTZpp6hpU2Y6W8nQStumok+lohrPA4c=; b=c81siaDjwvA6R99/p+2ny/E3aOFj3r2HHFj69yJzswuL9fGSBUGF6Kfl vt85tZskyLpUDPtPi2whqj3PHqZM3CybvUJsk1sOqR6Q3V+ENBQ3ExrSH UBHFjwsA/cb3qfPQmT3zUWCFm8uPbrkaB/yewNDuNwA7qtyKxGZN+95/3 G6MfsfLhJaleJUS7zkoyrn6563ikuWZgUE/M4CjJsg5uTIwcEKvTVWWNb ciE7L2Q9QdKGgJIN302CrnvqoGJEwerusJqdADHVcpp+ej5gS6mB2EcFu UYb0xtCHM6DA6KltXtWYRJROvrlBK+b3o0v0UNRqLye1EEA1Yy7obF/cr w==; X-CSE-ConnectionGUID: ttJz+fbXQH6Gpl6tVHgysw== X-CSE-MsgGUID: 6/PqdBOWQciC8XZqreLD5w== X-IronPort-AV: E=McAfee;i="6700,10204,11214"; a="26993403" X-IronPort-AV: E=Sophos;i="6.11,175,1725346800"; d="scan'208";a="26993403" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2024 10:05:37 -0700 X-CSE-ConnectionGUID: ShANvNzGT7q8vo86jBchXA== X-CSE-MsgGUID: gJ+G4MZcSOicoczue36+5w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,175,1725346800"; d="scan'208";a="111883403" Received: from silpixa00400886.ir.intel.com ([10.243.22.139]) by orviesa001.jf.intel.com with ESMTP; 03 Oct 2024 10:05:34 -0700 From: Brian Dooley To: Kai Ji , Pablo de Lara Cc: dev@dpdk.org, gakhil@marvell.com, Brian Dooley Subject: [PATCH v3 2/3] crypto/ipsec_mb: add HMAC SM3 algorithm support Date: Thu, 3 Oct 2024 18:05:12 +0100 Message-Id: <20241003170513.1292339-2-brian.dooley@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241003170513.1292339-1-brian.dooley@intel.com> References: <20240906123939.2508919-1-brian.dooley@intel.com> <20241003170513.1292339-1-brian.dooley@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This patch introduces HMAC SM3 algorithm support to the AESNI_MB PMD. Signed-off-by: Brian Dooley --- v3: 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 | 1 + drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 3 +++ drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 24 ++++++++++++++++++++- 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/doc/guides/cryptodevs/aesni_mb.rst b/doc/guides/cryptodevs/aesni_mb.rst index 951f8a7ca8..f1073c3c0b 100644 --- a/doc/guides/cryptodevs/aesni_mb.rst +++ b/doc/guides/cryptodevs/aesni_mb.rst @@ -57,6 +57,7 @@ Hash algorithms: * RTE_CRYPTO_AUTH_SNOW3G_UIA2 * RTE_CRYPTO_AUTH_KASUMI_F9 * RTE_CRYPTO_AUTH_SM3 +* RTE_CRYPTO_AUTH_SM3 HMAC AEAD algorithms: diff --git a/doc/guides/cryptodevs/features/aesni_mb.ini b/doc/guides/cryptodevs/features/aesni_mb.ini index abab926b36..b4e9a1f65b 100644 --- a/doc/guides/cryptodevs/features/aesni_mb.ini +++ b/doc/guides/cryptodevs/features/aesni_mb.ini @@ -65,6 +65,7 @@ ZUC EIA3 = Y SNOW3G UIA2 = Y KASUMI F9 = Y SM3 = Y +SM3 HMAC = Y ; ; Supported AEAD algorithms of the 'aesni_mb' crypto driver. diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index cd49f605b4..b8b68780c5 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -57,6 +57,7 @@ New Features * **Updated IPsec_MB crypto driver.** * Added support for SM3 algorithm. + * Added support for SM3 HMAC algorithm. Removed Items diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c index 4711b7f590..019867fe1c 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c @@ -381,6 +381,9 @@ aesni_mb_set_session_auth_parameters(IMB_MGR *mb_mgr, case RTE_CRYPTO_AUTH_SM3: sess->template_job.hash_alg = IMB_AUTH_SM3; break; + case RTE_CRYPTO_AUTH_SM3_HMAC: + sess->template_job.hash_alg = IMB_AUTH_HMAC_SM3; + break; #endif default: IPSEC_MB_LOG(ERR, diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h index 50f78bc3ff..51104f159c 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h @@ -754,6 +754,27 @@ static const struct rte_cryptodev_capabilities aesni_mb_capabilities[] = { }, } }, } }, + { /* HMAC SM3 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SM3_HMAC, + .block_size = 64, + .key_size = { + .min = 1, + .max = 65535, + .increment = 1 + }, + .digest_size = { + .min = 32, + .max = 32, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, #endif RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() }; @@ -865,7 +886,8 @@ static const unsigned int auth_digest_byte_lengths[] = { [IMB_AUTH_SNOW3G_UIA2_BITLEN] = 4, [IMB_AUTH_KASUMI_UIA1] = 4, #if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM - [IMB_AUTH_SM3] = 32 + [IMB_AUTH_SM3] = 32, + [IMB_AUTH_HMAC_SM3] = 32, #endif /**< Vector mode dependent pointer table of the multi-buffer APIs */ -- 2.25.1