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 71E61A0032; Tue, 17 May 2022 14:02:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5065440042; Tue, 17 May 2022 14:02:50 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 6FF3540041 for ; Tue, 17 May 2022 14:02:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652788968; x=1684324968; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=mwybFswjbkvnbqZU/277dTuMVWX4jQK34R02TsP55Gw=; b=fr2tJfGl/YlNvJpRGHSH8JnqJFKrffTSJxl12++6jSulEyAP8hgdwV1v aFfL9puf/Fc+vVNYAY0/R7rwpKBFcH5/Hm1UzLuUXGPwGE+zVdmOmiiFn xozIwNKI76jNglbUhK3rkVO77SYtFhjO8dCUwUN/VJxjbAhvh/ZzL0xN7 jkJ5LmPoA7sk5WaRJ5JQRwE2T/rjvvev8dXt+RdRWvQdFKImtCw59/eVQ Hvn1z0I7ouog6KspfQsb35lGSBpQqLlH5cI32LURt43Bp25IeyoG43QP8 OMgznjnbcBi4Zf3ljh5DfGpLiX50kQj7FodnBFTRfTIEg71fbGx3JGLLJ A==; X-IronPort-AV: E=McAfee;i="6400,9594,10349"; a="270846964" X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="270846964" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 05:02:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="574489455" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga007.fm.intel.com with ESMTP; 17 May 2022 05:02:47 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 17 May 2022 05:02:46 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 17 May 2022 05:02:46 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.47) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 17 May 2022 05:02:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FetZJxOsgEvqooCshE9Ug6hjroEfEB96sbENQL/jWgHqceluZnM8XIUdDTmM7zyfHDYjgclXsb7wkQzFmtLUFDhJ3aUuYEI3JdkoRtecCHc33N2uvB8Ogx4RZKoEF1WFcVyAbam3+F1JRSAipThzcqDpvw/KyzrCHjt1nx5bz/fLaSYC3PWOFbBLUsTxlVbl/vLmiVhbE73OQQOg/4XUUwWiiH1t/GtxDqOdOAxrYX6dSdAjbfGS0So5eG/U+wiPbvVQeg6iTs4wbs7NBDyJNQXDQ5hOEOKCoWhN/XlHz4qb2+gHIaONKaVXpaLBZ5PZrzQ4Lb0jcf9VcYZo0vQG0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QlhNzsNyiZAvubdmBCpXRnDdWL9MxaJeTaqEpGA+T5c=; b=k705HQ9wodIfHTpRCA7D5GeC6h/BoUsWKixTk5Aa35KNFJLEYT3BB4XQ5hcFd7ncIuDUlhwaoaax8WaXSoLhCLfmPnZ3lDA6ZsiIqZzXQVoZMklJeUqGa+nT1R2uOFmZBdvmF5PdwsoxJKCw/ayZ0if5WqHYSMfuY4+lTWLROPYYh4XBMa7psDk/td+TxMJ6ZZDFhkQLO+GSw8Q53WSiNEPVwih2dnAPFbLaq00aNApSNG84cJWqkzE5Llj4nqrnXft7rpwvosaAIOBia8ANEOmoQfo9Nk1LDhTOJ5pZe9c+LjIWeRAcTtROrENa/qwUKkf3JgUpnI9proDouvVaTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH0PR11MB5013.namprd11.prod.outlook.com (2603:10b6:510:30::21) by CH0PR11MB5562.namprd11.prod.outlook.com (2603:10b6:610:d5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Tue, 17 May 2022 12:02:39 +0000 Received: from PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::fc0f:1644:98b5:be1]) by PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::fc0f:1644:98b5:be1%4]) with mapi id 15.20.5250.018; Tue, 17 May 2022 12:02:39 +0000 From: "Kusztal, ArkadiuszX" To: Akhil Goyal , "dev@dpdk.org" CC: "Zhang, Roy Fan" Subject: RE: [EXT] [PATCH v2] cryptodev: add elliptic curve diffie hellman Thread-Topic: [EXT] [PATCH v2] cryptodev: add elliptic curve diffie hellman Thread-Index: AQHYWhz1IuRwcJg7gUGNDiQr5sCqY60h9QiAgAEefjCAAAMLEA== Date: Tue, 17 May 2022 12:02:39 +0000 Message-ID: References: <20220427095524.2547-1-arkadiuszx.kusztal@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 96e98bfc-cdb1-4113-1f59-08da37fd23b9 x-ms-traffictypediagnostic: CH0PR11MB5562:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aBpXaYDmJEzGsiD5E6+QYR7s7MV2Qu+EzOqRgCT/vmWKE5G2gDGZmiTjygd2BVBMBCuYDh0CX6eBvnG8xQ3a2iJf3aEm/II4etKkFAnm/FdgDa3fOd3N+YfMVrvs+PTMOD5FO2mVdRWXNCGv2960OSVgBSssHI729hg4h54cjM0900QzQr9i1XQvdlnI6ZZRHgWgbfpHlKdhLPL+QidgUcb2mZfzy/izuxFFyKO4yvJYc1MfgYCuS7qI2FI0kU7pbMvQvcE68SbpsCWPIjZ8AOPmzf3mhXqgGKc/ZXCDShqCN8aqqBI+dWkEuUkcYnoYVWlvgvO33BoRMJ70GV8Gfp+jGVnjNKjP9bDnmJiKM6bhxPEdXQUg9AqunZf++ywlY3vrlzJzcoPePr8bCIKxMXRSrIxrAekNnBN3H5uuQYbJ2bxTd5ZW/yFANsem8fKytyMZMxONA24n1kM22fscwzLr0S+qIV2/XOApCCrr5Y0tFPu0jsmSxsfqemErgtxxF5MbDwdT4fB2MLYdoun5wrEfiJwUTHETrOih1488fGevd3/KcOoY90YiEwTOscq1O7R4TKquCiJRT2DaeXaXWkxzg/25YlEZWagP/KQ1srJNkzgK/DV1YiTMRzLgN5w8KTJytSFZydZsq798cTcQnMY1PP1qL213jnX1VN1IMA8iblWHxwzxQdtyQW1F2o6lztoF2mWDFyStwVPEXxrDxg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5013.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(110136005)(76116006)(82960400001)(8676002)(186003)(64756008)(38100700002)(66446008)(55016003)(4326008)(86362001)(122000001)(38070700005)(26005)(2906002)(83380400001)(53546011)(9686003)(7696005)(6506007)(5660300002)(2940100002)(33656002)(52536014)(8936002)(71200400001)(66946007)(66556008)(66476007)(316002)(107886003)(508600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?bjEdqI6lu66GKRDWl1iCKTBCAhX4dFuFxozk1Nhzdq7UmzPFBpviBPx7Oi5R?= =?us-ascii?Q?CO7cf5yutdStUcxzSFIKRJ+l+QEdwiHwtcfnphyKDegRYofJwVt0XUkZn/Ui?= =?us-ascii?Q?j0CrmpYRLlYbiNLZfLb14b7Jt2o1S3sPU79krFIakO1agHoNmcXxTku2NdkS?= =?us-ascii?Q?/ejQbsL8jZ/4T+bZ+ZdJd6xfLQbStljmgTQcPuXHHIq+qGbF+XRNoVAb5qgD?= =?us-ascii?Q?XmmTlVRnTtmQTX8hSSllUu0qSRik+mFleSReDcogR9SNuKNueu75JbItZcfK?= =?us-ascii?Q?8+E8Z6F/HPYnuQDYR/kSpHdPYSBWqlvZwo2ee5aKJyebVPI/f0ktS4y//8uE?= =?us-ascii?Q?AJeBI06bzZ6zEKZ0ArS4IlXuV3hjXT9VRZaBiv9WLKrJ02KHOVymfrLMZa9e?= =?us-ascii?Q?/ldvb6Tw/TlXLu97T88b8b4YabhTBVNIwcnb4LX+Yi3PU1+r/6o5Mp6m52nc?= =?us-ascii?Q?f6Zvk92D/gnKHjDPUMNDJwy33A4qUn3HBqs20c9fpyteegyd/0IzUbrMp4ju?= =?us-ascii?Q?N4rT+qWnvMG0awba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?= =?us-ascii?Q?EJHBqtCFc1KHttcsCmj23gd5+/QQ23oBeAdvo4KYUzTY7+Bp+EL0UI7mb5RP?= =?us-ascii?Q?u3LORze/YuW1CyZYtmKVnV5xzFgYb+/Zx4JyQNBxu6lrpnDnsRNu5ixebtry?= =?us-ascii?Q?r5Xp9us38rm9XTDfJrG4PT+YmcrGLe0hkTyXPMlZKpq9L1IZeQiXe/f8N5XJ?= =?us-ascii?Q?H3+pOK1sg+wp3lADy4NziRqEqJGlrcl1Fhbw3pDAkledgdq1JRntiA84L0Z0?= =?us-ascii?Q?o67mDbMjVYXKrI1jPqgX9oDDv7Z8nbsuGBGtl2FqxL7IwHShFYcQO5p8ZfOP?= =?us-ascii?Q?LIDRzTEPUeYI5x0fkziU2cLFFbSA8Aw=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5013.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96e98bfc-cdb1-4113-1f59-08da37fd23b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2022 12:02:39.1465 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Khxo+xMqJxAj7hbtH8Gj4vSjOpzmB/DngwDUjoc0RFJ0ZT1HNB+leXiFLdErHEGO+jc2051eoe+PROTuQv8xkrtm/H7tpTRMdoYXZjZDqV0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5562 X-OriginatorOrg: 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 > -----Original Message----- > From: Kusztal, ArkadiuszX > Sent: Tuesday, May 17, 2022 1:58 PM > To: 'Akhil Goyal' ; dev@dpdk.org > Cc: Zhang, Roy Fan > Subject: RE: [EXT] [PATCH v2] cryptodev: add elliptic curve diffie hellma= n >=20 >=20 >=20 > > -----Original Message----- > > From: Akhil Goyal > > Sent: Monday, May 16, 2022 8:42 PM > > To: Kusztal, ArkadiuszX ; dev@dpdk.org > > Cc: Zhang, Roy Fan > > Subject: RE: [EXT] [PATCH v2] cryptodev: add elliptic curve diffie > > hellman > > > > > This commit adds Elliptic Curve Diffie-Hellman option to Cryptodev. > > > This could be achieved with EC point multiplication but: > > > 1) Phase 1 of DH is used with EC generator, multiplication expect > > > setting generator manually. > > > 2) It will unify usage of DH. > > > 3) Can be extended easily to support X25519 and X448. > > > > It is not clear how adding ECDH option will achieve above three stateme= nts. > [Arek] - Sure I will add an explanation, more or less like this: > 1) - EC point multiplication allows user to process every phase of ECDH b= ut for > phase 1, user should really not care about generator. He does no even nee= d to > know how generator looks like, therefore setting ec would make this work = for > him. > 2) - Instead of having {dh_op, ecdh_op, x448_op, x25519_op} would would h= ave > on DH combined with different types of xform (dh_xform for FFDH and EC fo= r > curves). > 3) - Addition of field in the union should be enough, provided that curve= s are > added to enum. > > > > > > > > Signed-off-by: Arek Kusztal > > > --- > > > v2: > > > - added ecdh comments to operation types > > > > > > Depends-on: series-22684 ("cryptodev: move dh type from xform to dh > > > op") > > > > > > lib/cryptodev/rte_crypto_asym.h | 46 > > > +++++++++++++++++++++++---------------- > > > -- > > > 1 file changed, 26 insertions(+), 20 deletions(-) > > > > > > diff --git a/lib/cryptodev/rte_crypto_asym.h > > > b/lib/cryptodev/rte_crypto_asym.h index 4697a7bc59..64d97ae054 > > > 100644 > > > --- a/lib/cryptodev/rte_crypto_asym.h > > > +++ b/lib/cryptodev/rte_crypto_asym.h > > > @@ -91,6 +91,8 @@ enum rte_crypto_asym_xform_type { > > > /**< Elliptic Curve Digital Signature Algorithm > > > * Perform Signature Generation and Verification. > > > */ > > > + RTE_CRYPTO_ASYM_XFORM_ECDH, > > > + /**< Elliptic Curve Diffie Hellman */ > > > > Can we add this after ECPM? > > > > And we also need to remove the LIST_ENDs from Asym. > > > > > RTE_CRYPTO_ASYM_XFORM_ECPM, > > > /**< Elliptic Curve Point Multiplication */ > > > RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END > > > @@ -112,9 +114,9 @@ enum rte_crypto_asym_op_type { > > > RTE_CRYPTO_ASYM_OP_PRIVATE_KEY_GENERATE, > > > /**< DH Private Key generation operation */ > > > RTE_CRYPTO_ASYM_OP_PUBLIC_KEY_GENERATE, > > > - /**< DH Public Key generation operation */ > > > + /**< DH/ECDH Public Key generation operation */ > > > RTE_CRYPTO_ASYM_OP_SHARED_SECRET_COMPUTE, > > > - /**< DH Shared Secret compute operation */ > > > + /**< DH/ECDH Shared Secret compute operation */ > > > RTE_CRYPTO_ASYM_OP_LIST_END > > > }; > > > > > > @@ -385,34 +387,38 @@ struct rte_crypto_rsa_op_param { }; > > > > > > /** > > > - * Diffie-Hellman Operations params. > > > + * Diffie-Hellman/Elliptic Curve Diffie-Hellman operation. > > > * @note: > > > */ > > > struct rte_crypto_dh_op_param { > > > enum rte_crypto_asym_op_type op_type; > > > /**< Diffie-Hellman operation type */ > > > - rte_crypto_uint pub_key; > > > + rte_crypto_param priv_key; > > > /**< > > > - * Output generated public key when op_type is > > > - * DH PUB_KEY_GENERATION. > > > - * Input peer public key when op_type is DH > > > - * SHARED_SECRET_COMPUTATION > > > - * > > > + * Diffie-Hellman private part > > > + * For DH and ECDH it is big-endian integer. > > > + * Input for both phases of Diffie-Hellman > > > */ > > > - > > > - rte_crypto_uint priv_key; > > > + union { > > > + rte_crypto_uint pub_key; > > > + struct rte_crypto_ec_point pub_point; > > > + }; > > > /**< > > > - * Output generated private key if op_type is > > > - * DH PRIVATE_KEY_GENERATION > > > - * Input when op_type is DH SHARED_SECRET_COMPUTATION. > > > - * > > > + * Diffie-Hellman public part > > > + * For DH it is big-endian unsigned integer. > > > + * For ECDH it is a point on the curve. > > > + * Output for RTE_CRYPTO_ASYM_OP_PUBLIC_KEY_GENERATE > > > + * Input for RTE_CRYPTO_ASYM_OP_SHARED_SECRET_COMPUTE > > > */ > > > - > > > - rte_crypto_uint shared_secret; > > > + union { > > > + rte_crypto_uint shared_secret; > > > + struct rte_crypto_ec_point shared_point; > > > + }; > > > /**< > > > - * Output with calculated shared secret > > > - * when dh op_type =3D SHARED_SECRET_COMPUTATION. > > > - * > > > + * Diffie-Hellman shared secret > > > + * For DH it is big-endian unsigned integer. > > > + * For ECDH it is a point on the curve. > > > + * Output for RTE_CRYPTO_ASYM_OP_SHARED_SECRET_COMPUTE > > > */ > > > }; > > > > There are 2 questions for this above change. > > - why is the order of parameters change? [Arek] - order now reflects, order of Diffie Hellman operations, but it is = not big deal, it can be the way it was previously. So there was no addition= al patch only for that. > > - The patch description does not describe this change. Could you > > separate out this change And provide proper explanation to this change? [Arek] - sure, I will.