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 3B4DA4591E; Fri, 6 Sep 2024 14:39:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E7C142EF9; Fri, 6 Sep 2024 14:39:46 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mails.dpdk.org (Postfix) with ESMTP id 2E417400D5 for ; Fri, 6 Sep 2024 14:39:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725626385; x=1757162385; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pypFK1LxqG61BwQ6rUAsD2rBiqsXj61NddKbQBzzISI=; b=MeHa73lulO5Hiw1MckwupTo8/xw12ckhGJOfVnMAj7DousunGu4Z5WSe mDAhB0LBVxdjxhUf5In8YIzvba4eBe1l1B7nE+IKJZzCMYy8sIyyGMKxY eYcxaV9ubExvNJR966+oREhJB4xa+s/KpIcyNe+JmIfEOIiQHdJ2wDLCg tOCkBAVTiIwxdWvVutF16wQ70LQe3U2hYW1tbFkrptuvl0Gp8IdNwwgmC niCx1klQvdHi83v5vQvB4U72wAYgZsSX+QMbYT1p7gK8OVQ8EH2ekRI0f hQQ50C+xvMP2z3iDiQQ+tG+8+daEQd4sC5QzXuC3lAqjZoxkjo49MlnyB A==; X-CSE-ConnectionGUID: RIHnjk6ATdqOyLGlJdbYMA== X-CSE-MsgGUID: jb+4cxTyQ0aUKTN/9XiZjA== X-IronPort-AV: E=McAfee;i="6700,10204,11187"; a="49797924" X-IronPort-AV: E=Sophos;i="6.10,207,1719903600"; d="scan'208";a="49797924" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2024 05:39:45 -0700 X-CSE-ConnectionGUID: 5N6VkHwvRWirT7L9HH6OhA== X-CSE-MsgGUID: Bre4baYXR4eQjlDi4UXF0Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,207,1719903600"; d="scan'208";a="65643018" Received: from silpixa00400886.ir.intel.com ([10.243.22.139]) by fmviesa007.fm.intel.com with ESMTP; 06 Sep 2024 05:39:44 -0700 From: Brian Dooley To: Kai Ji , Pablo de Lara Cc: dev@dpdk.org, gakhil@marvell.com, Brian Dooley Subject: [PATCH v1 2/3] crypto/ipsec_mb: add HMAC SM3 algorithm support Date: Fri, 6 Sep 2024 13:39:38 +0100 Message-Id: <20240906123939.2508919-2-brian.dooley@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240906123939.2508919-1-brian.dooley@intel.com> References: <20240906123939.2508919-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