From patchwork Thu Apr 7 06:28:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 109404 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EDDADA050B; Thu, 7 Apr 2022 08:28:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD51E40689; Thu, 7 Apr 2022 08:28:28 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 2EAE54014F for ; Thu, 7 Apr 2022 08:28:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649312907; x=1680848907; h=from:to:cc:subject:date:message-id; bh=MlpjUdd7wqT++9qj6NvFT4Evcgc8KAE88R3dhiP0rN0=; b=UUiQEd8mYz7DoX6c3lvw6S7H/rgs7fw6RiBrKqyRU1IMYoJo1YWkcx8t VAVWzp6HT/iNWZlaTfLwOSa0gqi+K9656uWF/KdMeOve79TXOaiPQvAJE /hG6pV00lmNGhgPP8cmBg4K8rSEQ5CMlLeF1O0nR6bADrV4y+G5DLto7I XQbOwKTMzwDBMsw01ihLqI5gSUtnT0DreBeY3oJfNFMiS5R2Cgi2F20gV 5LO7BMR2yz68rgOZt0hvHLuax7D3K/7Y1U2vz3xbiTZggbzIsmzeTSVAp 0RVGuLfGEPVZvRoTSw3vtZwo6WtRRwpAmJbskKl3e/TiTJy71j04Ky0u4 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10309"; a="243375667" X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="243375667" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2022 23:28:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="506028519" Received: from silpixa00400308.ir.intel.com ([10.237.214.95]) by orsmga003.jf.intel.com with ESMTP; 06 Apr 2022 23:28:23 -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 v2 1/2] cryptodev: move dh type from xform to dh op Date: Thu, 7 Apr 2022 07:28:19 +0100 Message-Id: <20220407062820.18136-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 --- v2: - fix applying issue lib/cryptodev/rte_crypto_asym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index cd24d4b07b..2f85027fb0 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,6 +389,8 @@ 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