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 3D6E3A0503; Fri, 20 May 2022 09:04:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ECC8F42BC0; Fri, 20 May 2022 09:03:13 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 7EFAA42BB9 for ; Fri, 20 May 2022 09:03:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653030192; x=1684566192; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=cTIbmLoX/Wzg1mra/WLVKXThIVmpz3P4IKpEw5glTVs=; b=YHfYUux6IEAUIQijY8RazBfKVryCkmdFRkmehFJsnMO9/ccRWbr7g7Pg y2lRBTpxIVhHLsY7AAG6ptjp71OVHmHQVhyhqWSJuppmsdcySWHbfexAK kfcCsbKn9GWrtp6SHBaRqgFp0dFdqcgVQHqKrMm/F+kufJ2OioiJwRwaF NuyXkaa+9hHa/xGPmpmwB+DoWnYUIzCuTmI7dRrEhKfhTHNeyoK4JrnMu fcs5CLrXXeHdd1Yd6H7EJKnD2w7OBhzkkXGI55EFBb5TPz7FDbdhfEJB6 ymbCCfFeJ+VEUeIqUcqoz/F2bimoPgoAAxK5Tfxf1P6oNK7MRcaBzep/d Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10352"; a="333140349" X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="333140349" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2022 00:03:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="599058306" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by orsmga008.jf.intel.com with ESMTP; 20 May 2022 00:03:10 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, anoobj@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH 16/40] cryptodev: move dh type from xform to dh op Date: Fri, 20 May 2022 06:54:21 +0100 Message-Id: <20220520055445.40063-17-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220520055445.40063-1-arkadiuszx.kusztal@intel.com> References: <20220520055445.40063-1-arkadiuszx.kusztal@intel.com> 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 - Moved dh operation type to dh operation struct. 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 op_type would be xform member, session would have to be to be created twice for the same group. Similar problem would be observed in sessionless case. Additionally, it will help extend DH to support Elliptic Curves. Signed-off-by: Arek Kusztal --- 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 b355cbe5fa..728a98f02e 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -250,8 +250,6 @@ struct rte_crypto_modinv_xform { * */ struct rte_crypto_dh_xform { - enum rte_crypto_asym_ke_type type; - /**< Setup xform for key generate or shared secret compute */ rte_crypto_uint p; /**< Prime modulus data */ rte_crypto_uint g; @@ -379,27 +377,29 @@ struct rte_crypto_rsa_op_param { * @note: */ struct rte_crypto_dh_op_param { + enum rte_crypto_asym_ke_type op_type; + /**< Key exchange operation type */ 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 when 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 op type is SHARED_SECRET_COMPUTATION. * */ }; -- 2.13.6