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 47CB6A0506; Tue, 17 May 2022 13:58:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF50540042; Tue, 17 May 2022 13:58:15 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 6936540041 for ; Tue, 17 May 2022 13:58:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652788693; x=1684324693; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=nLZCVI42g3UWjfdmvEAkMZONguKkCs/71TYQS7LEt+0=; b=IBD8PfAHJmphpqVi9gQYlfvOxh8O9mPmJ8b/2fZ1QNQgo7qakWVi6/yl pgWLQixNYJKjWhSbTgtrM5GlnsxjI/I3GHq2OteyYbp45Glduc4jF2iWK ncEIs/5XWbswRGfAVqEHxhbEhHoh1LkyX8ob4srOl0/uC9L8FjHhAtvLR +7hYUXOMKPw6aiij6ymn8uVjjIOxguche6MYSc+rac4s/Knp6gGpGtp5t Nvuwq2KgVMMe9rVSJ0gAJA66BD+yFHXyQZgdFhL22R8TIYnjuFW926zbY uZAiVAKb1530JuyOxoPzrl1FWYzYI/A/9niZ5Rau9xBl6oT66nCxVn2xt Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10349"; a="334199214" X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="334199214" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 04:58:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="638717460" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 17 May 2022 04:58:11 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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 04:58:10 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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 04:58:10 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) 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 04:58:10 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.41) by edgegateway.intel.com (192.55.55.70) 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 04:58:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=necs9iml8/QZ1Qy5JRFjE58ILgTto6JHVrnQpH6nC/Cy7JBT/kjHE3Ho9lR9x3qcwwkPu+a54HncglPH3uaNOc6XZawn8OVaqCObNy0l7E+Nn0/j8XWz7SFO9nWGPk2ho7nFq2Dxs12aBmrM+Rx0mFcqRGA198eKpC6cpkECpbW2SFr7fJUGJx0MpOQh1fQ6On+ToU93+pzOYNF1lp29qw1MhqWGK+env571Rts5d1urnpH1z7N5vRTVvFzLS7gjWh5t+uuk5JXOaVCt9oJigxC1ZDn4PjUfCVFOMXisrH0fqDpGtFta9lJN5XWpwTdAhosb8Ud1RYOErkiWYpDDpg== 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=Uv2FCCUCK1CssKDNS8teR1Rtg2FbgehjwlrkMgzGQZg=; b=kCN8gDSm8uO4RNr8DUSSawBWW48O5Hgy7c44UdzcEDrhy602/5e3lmAc6+HKAVRExxwsGT3jMOaZgjdtBPJ0Vd0loQgxVlL+RiKnGLg7V7UGTjiBarKP2Wlu/xPW2DLXuHFPZSqluM/bdiMwUw6oc8g71GEHETWD505hcV3ER+37ZhhRvbvqKOiaINZDQgVsOFBpDAPtdH3ldq56/Ue1oUlvf+FzYUzQhBjUAsFBRTUCR4I4p8n61penjtA2N0EJ4KiClLquKr45kDA4JcvAPTA2r5k/DyX97HW05LZAqQuiUNlPWm1CHwSBo7c+Hvk/416t9huQwM4CN6vmsFa1iA== 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 MWHPR11MB1598.namprd11.prod.outlook.com (2603:10b6:301:c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13; Tue, 17 May 2022 11:58:07 +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 11:58:07 +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: AQHYWhz1IuRwcJg7gUGNDiQr5sCqY60h9QiAgAEefjA= Date: Tue, 17 May 2022 11:58:07 +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: 38eb411d-92fc-4c07-6456-08da37fc81f3 x-ms-traffictypediagnostic: MWHPR11MB1598: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: B66bjCB8rsjyI+kvIX2pHlC1r+vk4p84RsTZBASzaQT6P19H1UKVvZ79G5/aBMS+E4mT8v2ljXjr5YtSx0ZNrDAOMWhfetwvnE5QLkTwyyPX+fASVZBvdwgc3CLqKUQWEa+PNoG7OWCuf/OPzxsCCGKkBWbTEn1ynhusRdK5r5BBJqMPc5we0OkTHNyysziD6K0MGUXIOWpuL/1WJ1stFSxdj9kGX8EER77NYlAJWmTwAIBDDD3cipGU5YheKtOuV/9sMNaHs2cMSTF00EwzDiN38HSlEOgYWeS/X4NWa7ZFtBvl265bpBi2wQ8B0MacYNFDI8siWih87mIDM5DBKn8NuOMn1piHNNgKaQj1DVyXIfeAhC8Jh2jXv2GNqSKriCh84AWX7VTEbG8h4LNj3vH/vHgp0+HLvvhfO//liPhokGfA6XsOuFaYI3bo++FqPX1+IhPaHZlArDP+PkZF4BEoQgOVPr4wHHom6Kc6cl6Fu48F6CQKvGKRFYLq4hl2aiG96b7W7m9HGhsf9c/d03MLUM32xRTIgexLWmmAlkUNWPfru8Woe27yFqiaIdEK+SxxiCqotY7Q7FIL6IzNfs5cNlscSIJ0mPeyxYH8ubNe8eED0K+5sb3T0A+NXM2cWAFnSPtXx0ah/nNx/kKapV4/0DlIR1HLHoQDBgWFyvFHgkzIcs9fIbuVq89Nh85zV2/B6lt+owHkNWG9oceugA== 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)(186003)(7696005)(38070700005)(2906002)(33656002)(9686003)(26005)(71200400001)(107886003)(52536014)(8936002)(508600001)(316002)(122000001)(82960400001)(66476007)(8676002)(83380400001)(64756008)(66556008)(55016003)(4326008)(86362001)(66446008)(66946007)(76116006)(53546011)(6506007)(38100700002)(5660300002)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?FqsttnW7wZhjynkB0opYEaIPT1CkMrP9yS2CZ4Yrmz+NzxZoILFO4GNQWchI?= =?us-ascii?Q?p/NpA8r2h3xHIrvmI4/OXZ01rxockFqEUB6g8uTAOA2yvoGZBj2f+xNcOQdR?= =?us-ascii?Q?cgc4z2GcFFYdq4dYeow0jEldsVtr8oxWNGex5cBRuB2PaBdfznxWEqudLHHl?= =?us-ascii?Q?wRQE6P5o7zreXiyUZ0Dc9GqXBAYtb299KEVKZR+iBpoi0vf9PyNl48AXQwup?= =?us-ascii?Q?s3eLc8c4vnu7Efk9Fu2/h6IdiN+MvEGymUxgWVSAQ0269XVZ86PazE8nrJOe?= =?us-ascii?Q?eKzZw+F10rzxabs0bpIFUwKfqMHH7o6ngiLflTYPyYjLlmo2P7xQr2rQlLiv?= =?us-ascii?Q?shOh+aEHOHYnWuU248YloCnHOd3CvVVCS+mwKbczICB8DmfNgEdx+wlRN2D7?= =?us-ascii?Q?6R8avBybbx0W5CQ25Z4kFEnLmTJk4Samqsgdn+maE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vz1zCSpt+yYhYZttZOn7I4jxx5l7ryHxn/edlHMy3F?= =?us-ascii?Q?fBPTrRkkVnB2SXWNPDwouEX6auwG4zKD5m57XzU5MsQRppwE6gWGNH8/cxlO?= =?us-ascii?Q?3qKBLLkVIQZUUqmU0D0829A+suVMpkhpZkTHwunIyo6s++ExVCFsa7KtkzvU?= =?us-ascii?Q?jGG27V0Z8U8UUnAyhl5KPn2drZXHVVevMpzxeco+TncHWy/FDojSh0fTTFrg?= =?us-ascii?Q?sOjlxziBdJLMi4hbk66rQFBTbzNj6gYdfxI6qzikPqVmqE4GTv60kKfZ2sEs?= =?us-ascii?Q?cwAZYYNiUvOBBh4/Tg5z0rfypZasnBW32e6LK/IMLpuV9SisUvA6vFO2dUsZ?= =?us-ascii?Q?A2LXpq5E6bNNeJUN0DaUdOZaTT4smg8MjSCZaUA6+0sed/YiLIqYfxfPdXwK?= =?us-ascii?Q?Or+2X68DL/rma1kge3+j/ZCeObu1fuk=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: 38eb411d-92fc-4c07-6456-08da37fc81f3 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2022 11:58:07.7377 (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: 5ExwkWcgalktZxEqUbPavrnEi80Ugjqf6qFcbPD62VMDfVD3GiLxWhvk+XBqz7PYoZ8B6BuDTuaZYy2OSq8h5Kzyyc8Ee9CdAs+wEvmyG0Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1598 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: 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 hellma= n >=20 > > 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. >=20 > It is not clear how adding ECDH option will achieve above three statement= s. [Arek] - Sure I will add an explanation, more or less like this: 1) - EC point multiplication allows user to process every phase of ECDH but= for phase 1, user should really not care about generator. He does no even = need 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 hav= e 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 curves = are added to enum. >=20 > > > > 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 */ >=20 > Can we add this after ECPM? >=20 > And we also need to remove the LIST_ENDs from Asym. >=20 > > 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 > > */ > > }; >=20 > There are 2 questions for this above change. > - why is the order of parameters change? > - The patch description does not describe this change. Could you separate= out > this change And provide proper explanation to this change?