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 33A12A050F; Wed, 27 Apr 2022 09:44:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBF3F427F7; Wed, 27 Apr 2022 09:44:12 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 775F241141 for ; Wed, 27 Apr 2022 09:44:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651045451; x=1682581451; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=uDg9z0i/GEm1b68mBpcLUcMA+biPn+Pe9seGtmJjbQM=; b=E5ingKJpFiL/D2a2QFUSE3IdGq1BZc8760xabALBbXRUgsGMgA1h5Fc8 AYDy02/33Vh5dA0bh49JvSMJDBTszklVRNE1hb8n9s9Su8YJAbhUDDHys Kc/e6ourH3fzjthpvqfPVHewnePcKUa+QUZZEQ12BMjcUhJpeBjde90jD 2i3tWicXZ0ofo1nXoY+U9CNAYqRvHVs9mYbXEAnwwoImxHD1K918E/nZV HlgiEttm1JPKmPUcpcvmra0LCYYGSmzUDnk/fxe9zy4SdalOKSq///8wc F7GXlpbkpykYvpXGcRskNXXiQvqqD+ksiyyqWg2NFXJdD7eeUBrL8mI5L A==; X-IronPort-AV: E=McAfee;i="6400,9594,10329"; a="246414397" X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="246414397" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2022 00:44:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="513562101" Received: from silpixa00400308.ir.intel.com ([10.237.214.95]) by orsmga003.jf.intel.com with ESMTP; 27 Apr 2022 00:44:09 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH v4 1/3] cryptodev: move dh type from xform to dh op Date: Wed, 27 Apr 2022 08:43:58 +0100 Message-Id: <20220427074400.2091-2-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220427074400.2091-1-arkadiuszx.kusztal@intel.com> References: <20220427074400.2091-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 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 cd24d4b07b..4697a7bc59 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 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 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