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 59480A054A; Wed, 25 May 2022 08:34:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA8BA400EF; Wed, 25 May 2022 08:34:01 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 29F77400D6 for ; Wed, 25 May 2022 08:33:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653460440; x=1684996440; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=wW24+RVWhtYv3VqUACq5wZTADOelo3EfOcZ/lJnFo6g=; b=aTkVOjurEdDKZ/wilS4EGGJajyJOpHIZnUOgIsfvttipUiRtSu4Jh5u6 aFC+sB4utqlVsex+Drk21goda0NzJrpijMz2K2WsQW0fsUzhq74+Ywq7U rhvqBJ+BvHqzQ/noUUlkGShxPPQUw2fMRKEBOkFpN/CWqqUR38MNq5GPu KYAhVzsRBt4gcjsx7VIgTiKaZvkl+bZnmFmzCicm8URugNxSH+F+JdbWG DXO+IOFzynvVgSKzamScgGxhlkCgCeue9Dep06h/N+vCW6nnRlcNMcaGb YDwec5ebjqz9fChzb0srKeqx38FnG3OAXrLAZNyAqHVlicRrf/mqGhvDi Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="273841762" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="273841762" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 23:33:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="608993947" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga001.jf.intel.com with ESMTP; 24 May 2022 23:33:58 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 24 May 2022 23:33:58 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx604.amr.corp.intel.com (10.18.126.84) 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, 24 May 2022 23:33:58 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) 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, 24 May 2022 23:33:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hokC8SSo98Lv3E/c3vH5yqDiRoLKRT2t9fdOJUJ8YZ8msF/0aeMVlTwLqcbyt5gpK2H7onzvhQmFhi3BKB53X4Iy67g+P4hxwQEgQYgd+CCbMjsNcM4jhNGsFt4IzV+92AZHeh0T9mXQkt37zp+PUiUBxY13yc+LxDzBfDDue2phKm88CVVhvJIOrlZgRjX8nskLqY19G7gJin/vF6oX6ixChMN4GxOOd9JMuEgPU3dmiacQRwE2uL45RByojHmEwdWTmopqrbTyFJs3XiXK7iZp8rIRo833QeCzvMRbLgGQgKDrUYXhl3Ow9xETKh5INpIWrqhtfLXRpv+QGJh5sQ== 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=j2kYR3wuioLmVscn/9p+HhW+IfI06qezV0h9ooyUsEg=; b=QXp0qnNX7Gt9vIQ3NlB9OjnmYfdZ7mL8jpILXglSr0HvVtJcnjVyLjLAZj6CdXC3q+1htdV86OJPSXBqaXA5aNlyvyISJqFvDzSQ+PDQwSu1bi2EdinV9d+70RrztFk2kwYY7C0NULRExK/DI9JaDgLW2cZOipI3FK/C1H6GH7DNu04NwIAlxDqLeej4a3KF9YCoBunF3nrYiMoavSIuYp2yFUSsCWbi26AuCwf+IzsCqLJDtGR1eMBaAvEWnG1EjgiTNz4BzcZLNchu547wP8fPXNbJ/K0U85xe9p8UCFrTCDaaaC0bpyPrLURUo1jMYyUOdv+98/C4SSMNxuR12Q== 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 BL1PR11MB5495.namprd11.prod.outlook.com (2603:10b6:208:317::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Wed, 25 May 2022 06:33:56 +0000 Received: from PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::fc0f:1644:98b5:be1]) by PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::fc0f:1644:98b5:be1%5]) with mapi id 15.20.5273.023; Wed, 25 May 2022 06:33:56 +0000 From: "Kusztal, ArkadiuszX" To: Akhil Goyal , "dev@dpdk.org" CC: Anoob Joseph , "Zhang, Roy Fan" Subject: RE: [EXT] [PATCH 20/40] cryptodev: add elliptic curve diffie hellman Thread-Topic: [EXT] [PATCH 20/40] cryptodev: add elliptic curve diffie hellman Thread-Index: AQHYbBe74aopJS6zVUCkbdrnTUtktq0t9cOAgAAtiTCAAABS0IAA/lKAgAAH1QA= Date: Wed, 25 May 2022 06:33:56 +0000 Message-ID: References: <20220520055445.40063-1-arkadiuszx.kusztal@intel.com> <20220520055445.40063-21-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.500.17 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: ff2b6fee-aa23-43a1-69cd-08da3e188b6e x-ms-traffictypediagnostic: BL1PR11MB5495: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: qsiy/gecUipPMsF7fK4ZdQlSaeGVPj6yUX8Yvwhg8xPHbMNjys4dP23NVnrZ167x7MyVklkdf1MmZ2DyHoXzj4GGa6dHXeO2mFDDhiIjBzuStXLhM9j9KHIvR7FiBxoRUTj/1z0eICHW+KeDSvtovp3AqcaiuzYdo9muBA155H9nuDBZIV+2i5CR9A+XwUrg3BjHFs3K+SRfXuVGOrU8fjRFV1WOVw2Ge0WB9LQy1XytEsAK9Lf8q4Oem9m8NGJcyZfNMegR/zpnA4Sm7P2pq+00F3mq0+gxOcQ3kNr8H8PZ4g8PGNvug/vV9laErXQ5uVmzFpzN5giNpzlNpFH+uS7wtA8glclU7O34NG9cdRkkyD63rsqBbDDDWMJAI+MVx3MWQVTaLkXORZ9hxp9Qz6RA7XjN30tr/v0aUcttP8EMm1JN0D8haofG5EKZ7xKH+P2WQWpY0KaWhtma6th49WTLncQ7r1cvjZ1dnoFx41mRiyP0AOG7Sf3eXdfANsQFGNKeXUx0glSpehg5BUTXOu92pmLRpFLg4Ee6bIe4cJJfmyLYpw95c0L+BsCV0M+M9aCBUTL7x6cd5OOSowIAHr3UbrZNfNli3ot5XyucUMWES+5BjDAFUWvCt4VZF5H5RpzbD5X6SUaEUlveJu2eQ1iVEat/wtXhLWlr++Qhlsoh6j/PzTgCZOrH3kWX5cA9/tZ9gctIXQMTM9QwjlNeg1hvfdXkWt0VO3aNXSMhJGRAhBdfCxy+wPMl0i2xZUFCURheqzw7evPzHZFE330a0EcVvKx7oJo3AVTsQtARxgc= 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)(54906003)(110136005)(186003)(107886003)(2906002)(33656002)(7696005)(8936002)(55016003)(316002)(38100700002)(83380400001)(66476007)(66946007)(26005)(66446008)(66556008)(9686003)(71200400001)(76116006)(4326008)(8676002)(5660300002)(64756008)(38070700005)(966005)(6506007)(122000001)(53546011)(86362001)(52536014)(508600001)(82960400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?bBN2O3JwWJ3FuvhYllWHodJ0p9u/WrkAylcXuysAjDY2TlczPXFv9u477iv6?= =?us-ascii?Q?yKEcZZ/QWN+sjOUWBi+LmI6NSf3J3AHlmVzvZ3x9hxJXB0Smnye2aWO+oNxb?= =?us-ascii?Q?8SG5MR/o1+feTlxDzV7XOZXXYd7i/JjDinxGBS7rc/KV19NyDImWiglzMtC8?= =?us-ascii?Q?4oEjkhotNABl5pQTq/p6WSyVBOAi2399Bhp7+kzj+Ngozj4sENREFSRVIXFc?= =?us-ascii?Q?IVMgpmpj3HLFXFNSaE9WEzf+t+v3ZnGgdcEMlnNhA6N/H4cJi0gf0aU290LZ?= =?us-ascii?Q?LaWEg3LdWkUGrKTLcVxzz39bvK7rR9U7bc5auHKrFV914joi6DV+tq4C32EE?= =?us-ascii?Q?S6QEnC5sT2pP9Xyu/plEMM6Z/S4qv+WfuYM4USyNFC4UBZ8Mr5W7XIxoCKqU?= =?us-ascii?Q?gdylpHuae4wqV0jPdMD1VfhIYM/h4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ascii?Q?dIb4a0TA9aKZPg/mg4sq6Ood3Cu4mmq/Hh9Kau6dpSGo8uhSA6QCD6vPEVLS?= =?us-ascii?Q?K9rr3KZlaq2XRXvwUxoNeyNwZvrK75oB2kL8YrDUGDbWrmFp7H/bNCjTNgfE?= =?us-ascii?Q?1fYo6QVoX5VCqaQTZhz8onuvLfaNxGV7JZ3PG07LQVWc3qh3XWOYqjAciyJs?= =?us-ascii?Q?8A+h4yrCJhxJbGeQcZLT+TAlJnQQKIr1lPdksj4f+pEn214dA8v3fMxSkCo7?= =?us-ascii?Q?XkAo7iD3jJrVVqgRJmPyxPw1sZbCZZVc6NRze/NGRwrjsO2UA49xdBfnAtI/?= =?us-ascii?Q?1DBk8I9qATlih7AWsllLEAZg3lGY6AdEsw8mmes1DygJZVIRpoNCjDoSzw3u?= =?us-ascii?Q?m0UcMF0lZXDZs01ufwz3g5gVSN5MePftaB76JRl7rNvX0uBn4X9Gle5D+pLr?= =?us-ascii?Q?tbiRFwex1KN9p0I/FobrFeiCHDH6JTA=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: ff2b6fee-aa23-43a1-69cd-08da3e188b6e X-MS-Exchange-CrossTenant-originalarrivaltime: 25 May 2022 06:33:56.5128 (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: gb4s2tweOMKRaQmLC+cTHGDiKouAmZUpa49B6+/nyAJUy6FHEBtx1NMCRqjkpDYUHLnMZVI3FwssOM6CShM+nOIQWgEKJKcqV+sJRhjv+is= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5495 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: Wednesday, May 25, 2022 8:03 AM > To: Kusztal, ArkadiuszX ; dev@dpdk.org > Cc: Anoob Joseph ; Zhang, Roy Fan > > Subject: RE: [EXT] [PATCH 20/40] cryptodev: add elliptic curve diffie hel= lman >=20 > > > > > /** > > > > > @@ -383,22 +385,28 @@ struct rte_crypto_dh_op_param { > > > > > /**< > > > > > * Output generated private key when op_type is > > > > > * DH PRIVATE_KEY_GENERATION > > > > > > > > Update with actual enum name for this as well > > > > > > > > > - * Input when op_type is DH SHARED_SECRET_COMPUTATION. > > > > > - * > > > > > + * Input for > RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE > > > > > */ > > > > > - rte_crypto_uint pub_key; > > > > > + union { > > > > > + rte_crypto_uint pub_key; > > > > > + struct rte_crypto_ec_point pub_point; > > > > > + }; > > > > > /**< > > > > > - * 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 public part > > > > > + * For DH it is big-endian unsigned integer. > > > > > + * For ECDH it is a point on the curve. > > > > > + * Output for RTE_CRYPTO_ASYM_KE_PUBLIC_KEY_GENERATE > > > > > + * Input for > RTE_CRYPTO_ASYM_KE_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 op type is 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_KE_SHARED_SECRET_COMPUTE > > > > > */ > > > > > > > > Is it output for others as well? > > > [Arek] - No, it is output for phase2 only. > > [Arek] - additionally there is still an option to split it into > > DH_PARAM, ECDH_PARAM, x25519. For secp and Edwards/Montgomery it > > should be ok with current approach but for SM2 we may need new struct. >=20 > I believe we need better documentation for asymmetric cryptography. And we definitely need better tests, I have removed part of dh code from op= enssl pmd at random some time ago and all DH tests still passed! I have added key exchange tests some time ago, this could be good start, I = have v2 for ECDH too. https://patchwork.dpdk.org/project/dpdk/list/?series=3D22401 Please take a look. >=20