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 6749245A68; Mon, 30 Sep 2024 15:55:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37FB4402A3; Mon, 30 Sep 2024 15:55:38 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by mails.dpdk.org (Postfix) with ESMTP id 3C9314014F 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=1727704536; x=1759240536; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KDu+XapqS90B/8yEv0UlblAtTLjPKe6jId0h/IEnxxw=; b=KAndlFIr7AkrOXUNMZU4jQCVenOGAtLw2V0Y0gJCOH/nMRtIGfKxBlus Bwc/lDeVLYG9cKISaurhH9Ln7K18xZCw8Q+31Q7ffF6mN0yiB0Ce5EL4v Dn6foTV2Guz4b5J87CbO+Vh07ufbgI5/WFp3e2CkW0ZBhw+TIITL1UJey HqcLoPxoTXShluMgjbZThVXQS3eQL/5Bl/bOR4Xh7sCa2FZfYo0GA4prR HnMSjE9wS+LrFaHXnmM/yhwewo6EWaZB2GT9mZOdUxZS6CRpQ426+9TiE iIqwqzDd6BXoDmOegkWr1ybiycDU/C+/cXdCyQOHlhtNisWvHjsRifkK6 w==; X-CSE-ConnectionGUID: 9mqtp+hzQCm2C+8rphyQzQ== X-CSE-MsgGUID: IRRcep2/SZa2t400vCCSfg== X-IronPort-AV: E=McAfee;i="6700,10204,11211"; a="26952501" X-IronPort-AV: E=Sophos;i="6.11,165,1725346800"; d="scan'208";a="26952501" 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:35 -0700 X-CSE-ConnectionGUID: TozJFM/0QlmuFhW9fiNKoA== X-CSE-MsgGUID: kzXAzGwTRqGXJrZVxMF+2A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,165,1725346800"; d="scan'208";a="110779904" Received: from silpixa00400886.ir.intel.com ([10.243.22.139]) by orviesa001.jf.intel.com with ESMTP; 30 Sep 2024 06:55:35 -0700 From: Brian Dooley To: Kai Ji , Pablo de Lara Cc: dev@dpdk.org, gakhil@marvell.com, Brian Dooley Subject: [PATCH v2 1/4] crypto/ipsec_mb: add SM3 algorithm support Date: Mon, 30 Sep 2024 14:55:28 +0100 Message-Id: <20240930135531.3494777-1-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 SM3 algorithm support to the AESNI_MB PMD. Signed-off-by: Brian Dooley --- drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 5 ++++ drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 26 ++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c index ef4228bd38..4711b7f590 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c @@ -377,6 +377,11 @@ aesni_mb_set_session_auth_parameters(IMB_MGR *mb_mgr, sess->template_job.hash_alg = IMB_AUTH_SHA_512; auth_precompute = 0; break; +#if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM + case RTE_CRYPTO_AUTH_SM3: + sess->template_job.hash_alg = IMB_AUTH_SM3; + break; +#endif default: IPSEC_MB_LOG(ERR, "Unsupported authentication algorithm selection"); diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h index d6af2d4ded..90d2702a01 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h @@ -732,6 +732,27 @@ static const struct rte_cryptodev_capabilities aesni_mb_capabilities[] = { }, } }, } }, + { /* SM3 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SM3, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 32, + .max = 32, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() }; @@ -840,7 +861,10 @@ static const unsigned int auth_digest_byte_lengths[] = { [IMB_AUTH_SHA_512] = 64, [IMB_AUTH_ZUC_EIA3_BITLEN] = 4, [IMB_AUTH_SNOW3G_UIA2_BITLEN] = 4, - [IMB_AUTH_KASUMI_UIA1] = 4 + [IMB_AUTH_KASUMI_UIA1] = 4, +#if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM + [IMB_AUTH_SM3] = 32 +#endif /**< Vector mode dependent pointer table of the multi-buffer APIs */ }; -- 2.25.1