From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67B90C433F5 for ; Thu, 7 Apr 2022 07:18:36 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4DE1240DF6; Thu, 7 Apr 2022 09:18:35 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id DDA8A4014F for ; Thu, 7 Apr 2022 09:18:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649315914; x=1680851914; h=from:to:cc:subject:date:message-id; bh=aHMoT8dKrRyWZcXtnP1zPVQCL0pmsBO13jn2wVsThFg=; b=l5gFShjhDLXiYou3BXIqXt8VHVwsV96cHx87dOpLvmwVSW2Md85UkR4K hp+nHDRLryJ4tTU/M/V4oU1ZOJr++P6R3yS2i6dWmjxnw5nG+NwmmWGgE WrFxIsHeUpK/dmcKMM5n7WKJwXoPRXmAxethsLVqm2YLd45CrKQJNIbkG qrzS/jxpNCPjKQo2IYLigHEvfPFD7pz2sWPaRzFi7HyNzcrv7s70uQtpY q8+KR+kxTmgHZK56OEHJiLPpj71zfTIYXkpss25cUnXppsWE686X8HZre t/GA29VmfzhlrajM4RajGPjo/n65JRLqecL0K9KBTGBhfYgZbWpHnv/5m A==; X-IronPort-AV: E=McAfee;i="6200,9189,10309"; a="241842009" X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="241842009" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 00:18:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="642374531" Received: from silpixa00400308.ir.intel.com ([10.237.214.95]) by FMSMGA003.fm.intel.com with ESMTP; 07 Apr 2022 00:18:08 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, kai.ji@intel.com, Arek Kusztal Subject: [PATCH v3 1/2] cryptodev: move dh type from xform to dh op Date: Thu, 7 Apr 2022 08:18:02 +0100 Message-Id: <20220407071803.18383-1-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.17.1 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 Operation type (PUBLIC_KEY_GENERATION, SHARED_SECRET) should be free to choose for any operation. One xform/session should be enough to perform both DH operations, if this is xform member, session needs to be created twice for the same group, similar problem would be observed in sessionless case. Additionally it will help extending DH to support Elliptic Curves. Signed-off-by: Arek Kusztal --- v3: - changed op_type comments in dh lib/cryptodev/rte_crypto_asym.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index cd24d4b07b..40c1d90604 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -256,8 +256,6 @@ struct rte_crypto_modinv_xform { * */ struct rte_crypto_dh_xform { - enum rte_crypto_asym_op_type type; - /**< Setup xform for key generate or shared secret compute */ rte_crypto_uint p; /**< Prime modulus data */ rte_crypto_uint g; @@ -391,27 +389,29 @@ struct rte_crypto_rsa_op_param { * @note: */ struct rte_crypto_dh_op_param { + enum rte_crypto_asym_op_type op_type; + /**< Diffie-Hellman operation phase */ rte_crypto_uint pub_key; /**< - * Output generated public key when xform type is + * Output generated public key when op_type is * DH PUB_KEY_GENERATION. - * Input peer public key when xform type is DH + * Input peer public key when op_type is DH * SHARED_SECRET_COMPUTATION * */ rte_crypto_uint priv_key; /**< - * Output generated private key if xform type is + * Output generated private key if op_type is * DH PRIVATE_KEY_GENERATION - * Input when xform type is DH SHARED_SECRET_COMPUTATION. + * Input when op_type is DH SHARED_SECRET_COMPUTATION. * */ rte_crypto_uint shared_secret; /**< * Output with calculated shared secret - * when dh xform set up with op type = SHARED_SECRET_COMPUTATION. + * when dh op_type = SHARED_SECRET_COMPUTATION. * */ }; -- 2.13.6