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 C9777A00BE; Mon, 16 May 2022 20:42:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7AA9C40A7A; Mon, 16 May 2022 20:42:06 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 14F9E4068B for ; Mon, 16 May 2022 20:42:04 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24GBB0Hq007593; Mon, 16 May 2022 11:42:04 -0700 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3g2bxsr7n9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 May 2022 11:42:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lzr04oXYZBVhaMgH+aU9uNKFEKlXyERj7ywE3+n76Ss3h3z+JtyP6f/xwyMLFllA84T8emUxfOs9iMYzXmy4Q5MOuveKMdMjc6Afgd7ozta3MX3gjZ9siLaWea4UzKehBYIUfExBc0pRpQAVkdq8qmWIpWg95xSlD9P6pPEXMLj6wDM53xgE5/5j45gzijT8sIbWCEkPOtkF2o/y2nYOhs5Rcc/qjSXtib+eWNZN2kJ2JqVpxJ/kZGNjOdhC4aOEPeZc+8BBq5H762XovazVLxJrCOVfGOpVkX5bgHpTfM/sEULvIm/VbAYOhXociRsfF7ogjB0AipM/RM+kZvaMXA== 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=EHkHbMV8+haLP0JIDwelJH7jhcugRUgyzjBVlo3rmj0=; b=CwJvOge0hmY3tTps20LEe42M8mPiImZqxCgl9LvBAR23JR3CPrmHpjI03GrvfUy/i50tJiCk2hUPuhr2ViLd91MHuxwoxpIMvBoqATbDBrEnsT1yYDtqf6SvL2fWtN57c9AC/l1GWVpFYg8y9kAjpk69M7XDFsfFabWATM2qPftw6R3ZqT6Rt/OIZKOysuual1TXh72xsYqzOddQbIZFPVG4AaNMdGhcxVvuTS6R2F4wLatIQYOhXl6EikZ0OC27xIoEKs2J0fDvQm4j5dTVVLEtDXnH/09lxh9WFnBxavpgGhO7das/HpjTCzzhFfvOIpOkyB9Lj6neX6B/IEVGOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EHkHbMV8+haLP0JIDwelJH7jhcugRUgyzjBVlo3rmj0=; b=VOnInkMcnNDg7zaGdMBdyo7KeniRKaLea8ZjDdJW/M24A5b/HfsavEkWFLgAQTE2juZRGxWo9DEqYI0ys1uEdWSSkFm/yYWtImhftOjn9BtfaNpdrAM4OQMOEhuoOJioQajW6f4EzKAyfU+FZPeWcI9YriUbFnjHaDrxIQeobJ8= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by BY3PR18MB4673.namprd18.prod.outlook.com (2603:10b6:a03:3c4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.18; Mon, 16 May 2022 18:42:02 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::9c76:3b01:eb04:db4d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::9c76:3b01:eb04:db4d%6]) with mapi id 15.20.5250.018; Mon, 16 May 2022 18:42:01 +0000 From: Akhil Goyal To: Arek Kusztal , "dev@dpdk.org" CC: "roy.fan.zhang@intel.com" Subject: RE: [EXT] [PATCH v2] cryptodev: add elliptic curve diffie hellman Thread-Topic: [EXT] [PATCH v2] cryptodev: add elliptic curve diffie hellman Thread-Index: AQHYWhzykVB5XvpnfkCXGkNBUugVmK0h8ozg Date: Mon, 16 May 2022 18:42:01 +0000 Message-ID: References: <20220427095524.2547-1-arkadiuszx.kusztal@intel.com> In-Reply-To: <20220427095524.2547-1-arkadiuszx.kusztal@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: be1ffd84-8dc4-4632-e8cf-08da376bc42f x-ms-traffictypediagnostic: BY3PR18MB4673: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: bBz0ffe2ms1n3SAUI5qMrbGQjslItICQCVlcRtA0lxnYwKXV7C6S3NKWUW3ioCNJlksvyEdVAl8lf09F3mCcfF4+PqEAfYUFi42m9g3KUUuLtLYZbpABoJjB7lIfUWFE0iZoXqfCG7eHhjTrIHNtk1ueN0Y9sf1CxORgzQCGkxB/Hl1cq0Gr/FU1tVh9z/83Y4cMWDEHVs0PektOLBSym3AvSp2GsytyZqyDfYMyZdrjvXF4xVKBrmlSAFaLtwoQr0mhINzoEKt6A/cJAFEifOqfygkPm2T7EhiGCi+ujElxfvdcwEVySswK+qjDFTBd+9haULWN4FE8+bnoNxiUiADmzz3QzVAuLQQx6fndI3j9P7Hu1F1pWFnQWNLTqFoz8MZHn0F2ar3xnQsNYXvwP8WZoh/Rv51oujT43R/5+zeTpn0L+lZ3ITPfjfwvumA8JeCgk6zILER94X9CY6LXzazHS6qQyulgSxg7HYKrwG7jxTyVSNwVV8sI6+RefcsRmlIdGEGelUSU0WSnbAWXdLvUmxpDXdKYr4SQfEaMPSLxTdJCLuQsHQhIwXtHH/wx5MUO1OR3GYUv+lGdnyPN25mjqTzH1m2lTRnDqAm7Km+eR3GhCaC3XsK0b9Rw0SJbRdpZBR1Ec3MIe7Ma38lh1lWxxAwIJEiVWZV0dzcusW0yugf3jmgWbNYS3MzqZMDDkkMSJaZ29qF7xJmQHa2bww== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(33656002)(55016003)(52536014)(76116006)(110136005)(4326008)(86362001)(71200400001)(66476007)(66446008)(66556008)(8676002)(64756008)(66946007)(2906002)(26005)(9686003)(83380400001)(38070700005)(6506007)(7696005)(55236004)(186003)(5660300002)(38100700002)(508600001)(122000001)(8936002)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?p/4V5OLmQhLzXH+P2vKwy87sOuvr6pUPrZO/oI6Qu8n+CziV1BzR+Q8DJutH?= =?us-ascii?Q?wJjTcCowiedAnRU6WIZLt2+OShJUhexMRQ3Q4wCVJMYw1IPWDQn982RlBx5k?= =?us-ascii?Q?28FfeyGAt0oCjrCR6lnQGmsap/iAc9Nw2AUr+M06NnhttPsWytUHsI9BIx0O?= =?us-ascii?Q?jUGCQeoA0sAA9pjJ3o3uiZeRr97/WjU1yYC0ilY3KEVGMBgoLhLBI12rcg8p?= =?us-ascii?Q?yj4eJygMbX0OxHbI+cvd0ceM4mSHT923BvmL3gNI+1l8YDN+TO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rpuMHCTZnSdZvzT287cPVgfkOnDq5RmvgR/Tar9?= =?us-ascii?Q?xwK9wyqNQ9lu2yQtOpwNKuoWw3aCKsZhiulwi9ZuFgMgB4WDsBunsJu5kDyM?= =?us-ascii?Q?F+rA52NPU1crAASU0ThmAPCruihU3X2Pm1d3QHd+9gczExPG4HUDFo3yrCR1?= =?us-ascii?Q?5LmzM5Oke3LNy6dcnrbM5d8dHM3QdYlRZaaYMMCVQJm6hBzwQ8cGstJa7qJ7?= =?us-ascii?Q?iVmjvtMV90fbiAvwGzPJ0nQU0BVpMQbOg/6OLi/1LQdtTRnt6021Z4VUSfim?= =?us-ascii?Q?LlkV26iyW8BccgmoXMNbs6dh1DGc/yF4tF7FDZ4phwvJAU4gpKR0qbRohcdb?= =?us-ascii?Q?j1kYz91fYbIt1fg5yhnvhb2ZCY6ztk9t+ieGwfP4GT2pbzv4hrJpmN7sf0jD?= =?us-ascii?Q?SWCqeHyu4j/2FpIxlx+4cmIbL4OJX4G8rAAjPdCbkIlLp6WAX+gVsRyrNorm?= =?us-ascii?Q?/o0csQOWC6yIoEmYCw0NaXtyuSev0RYFAPKwAyVaaxf3vgYJ0RVAFo5KtEU0?= =?us-ascii?Q?LURpOl8e0lXe6iIuVQK58z0aBGIlr0a5laL6b+ukLJGMjM3cL2x8ujH5S49J?= =?us-ascii?Q?LyDbWeTbPw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: be1ffd84-8dc4-4632-e8cf-08da376bc42f X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2022 18:42:01.8380 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Cqmq3Ukx5Ym7xpWPlSdcmMv5v+VWdyEDNLgNz9Kl18rD/ZU1JylQP6uZS3EAxb95OqIVrxWJ/I/mgErd3cF6cg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR18MB4673 X-Proofpoint-ORIG-GUID: OLY6z2gnLWq-r6mrAGCipgr_h4Rcy7b7 X-Proofpoint-GUID: OLY6z2gnLWq-r6mrAGCipgr_h4Rcy7b7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-16_15,2022-05-16_02,2022-02-23_01 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 > 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 statements. >=20 > Signed-off-by: Arek Kusztal > --- > v2: > - added ecdh comments to operation types >=20 > Depends-on: series-22684 ("cryptodev: move dh type from xform to dh op") >=20 > lib/cryptodev/rte_crypto_asym.h | 46 +++++++++++++++++++++++------------= ---- > -- > 1 file changed, 26 insertions(+), 20 deletions(-) >=20 > diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_a= sym.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 > }; >=20 > @@ -385,34 +387,38 @@ struct rte_crypto_rsa_op_param { > }; >=20 > /** > - * 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? - The patch description does not describe this change. Could you separate o= ut this change And provide proper explanation to this change?