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 0C4E145A68; Mon, 30 Sep 2024 15:55:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7321840648; Mon, 30 Sep 2024 15:55:39 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by mails.dpdk.org (Postfix) with ESMTP id 1F4AA4014F for ; Mon, 30 Sep 2024 15:55: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=1727704537; x=1759240537; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pypFK1LxqG61BwQ6rUAsD2rBiqsXj61NddKbQBzzISI=; b=JaT47n7v80u0JVnVw7s+ssGTUOp4R/Tjyb+FjbX7JH0VAa+SnY/X98fl LsCKbejkSq5GnYuRCjo+7O2hGQccisRG3E5cGbFsguQ8aarvXZqVi/ZyV r26Q3HkNRMEI55zP0gJSSPNP4sNtVxTDDzXiBghvnyuQouj69g5lpvgaU jQkjWEhewYFikijNYQB1pc7NBXWBtvDCHGqw+LiOS5MHRrUEWQrnljDgp flGVJjrI7q7KYsgbHD0WNE7t+0fzUkyLbNKTDqQNtXdTLhskrTnxyPPTO ctlV7Lriar37YfZtkRXna4Y9XsF5Nf3xyOhPOCaZVxbYXwUJQJTPiLw4y g==; X-CSE-ConnectionGUID: gpDRtcaqRZiVaEkmcD+kFg== X-CSE-MsgGUID: z+su7IFpQu+10jF3Hf8pdg== X-IronPort-AV: E=McAfee;i="6700,10204,11211"; a="26952504" X-IronPort-AV: E=Sophos;i="6.11,165,1725346800"; d="scan'208";a="26952504" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2024 06:55:37 -0700 X-CSE-ConnectionGUID: zc4hpiwTReWhrb7YeGzp1Q== X-CSE-MsgGUID: EuaKV9ASQgGN5fIgzc7Ecw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,165,1725346800"; d="scan'208";a="110779928" Received: from silpixa00400886.ir.intel.com ([10.243.22.139]) by orviesa001.jf.intel.com with ESMTP; 30 Sep 2024 06:55:36 -0700 From: Brian Dooley To: Kai Ji , Pablo de Lara Cc: dev@dpdk.org, gakhil@marvell.com, Brian Dooley Subject: [PATCH v2 2/4] crypto/ipsec_mb: add HMAC SM3 algorithm support Date: Mon, 30 Sep 2024 14:55:29 +0100 Message-Id: <20240930135531.3494777-2-brian.dooley@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240930135531.3494777-1-brian.dooley@intel.com> References: <20240906123939.2508919-1-brian.dooley@intel.com> <20240930135531.3494777-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 --- drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 3 +++ drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 24 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) 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 90d2702a01..24c2686952 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h @@ -753,6 +753,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 } + }, } + }, } + }, RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() }; @@ -863,7 +884,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