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 B4627A04FF; Tue, 24 May 2022 16:55:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B5974281F; Tue, 24 May 2022 16:55:38 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 3F17E400D6 for ; Tue, 24 May 2022 16:55:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653404136; x=1684940136; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=sebUdMcidGiS/qTkY31JTCrCqUm9BDRF+oz7QE+BlRg=; b=KsRySXAJzYzqeqFMyQGR8o5h3tedm4OOGXwapRLCTKk/UQDddUjX3UDw ULWAwplIwXF3P8Eox1Ta9yG1e9q0Ei+uwy/02vlHtyxGpMgUcmKyoGfYs vUAJy21DL1cZ0lmzXPzei9G8YxcstOb2zPkqDoJ+XgOr/JPKU4BtHZA5O MTiGdyqu8pEpvrR0PkYJ+j7Xr6iK3MUUJS40eYGfHgplXLgMPUo8mHUaq MJ8/7ntzRTZalJ8/8T3GbGBhVgPr89s7/BFUd6EXvVO3SoBGpzOnPgdkW O5C2P8aZyGqKU3+1GJSauyNT/WPpPDrWVlDW4fNQVoklJmMq6YUlV11+0 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="271126517" X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="271126517" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 07:55:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="641970044" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga004.fm.intel.com with ESMTP; 24 May 2022 07:55:35 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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, 24 May 2022 07:55:34 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX611.amr.corp.intel.com (10.22.229.24) 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 07:55:34 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx605.amr.corp.intel.com (10.22.229.18) 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 07:55:34 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (134.134.137.102) 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 07:55:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTWS0UfLEsfmtmIMiWJXb2Q7VMC4IDMRs5zJbZOZ4Cba0D1Qk8ZU8P9k5XHalUcHDH30iUGZZof66bEo3P2t8JT4k1qDVFwKiYAadlO497HkVlcf2dimgXV1WkTlGML6YERPjg+ERCV+C0WPd0BB0548IALrYlHnwLJQwXlXhJiEmK9R+ZGj6O7qdMhuR4IBqpF2VUkKbdJIzWjwITJVDfzQ8YCOjac1GAwCBB++BYQlE0bCCDUH1iwzmyH/E2ASGb+Uvj/xbCiVzHce9jyCQJZ/PxiB9J3PNe84tD2lN+zTskxVpjiVbJJzvwVw9IDU6kRcOti4reMDW0GET3yQ0w== 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=ImYfQyfi10IJjLr1OrDNXEbD1KTN7SkWzpGzukei960=; b=TnsgLa1lSGbJlP0IzX7xlHE5yY2Y9Tto04/N5QDIKvhNvhhz8KLt0FGXO4/zL0x8k2ID8i2559MEVcGFitXX/7OkiMn3A3nj1Z7VWHSttXDEAvC9FXbQS4/6w5i/qoqo6Sd/GjREVzfxw9xl2fjd6g6krhATCoZn/Mz2efzKn6TId31q8H2JAc8fVjLMPrhi0HimUAJ/x3R+8Dg+oP7TC82vGb1Qa21Y6l06Pgdj2WiExMmdyazPZa/HWtvBg5+Z512aU8ydMMce1Ve2INdrL3pFJ8qrKAGkk+/bm8qUxSbHDyllDemlt9VecLw0WsGbL+WUGfJyPHy27mvFVWB0cg== 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 CO1PR11MB5009.namprd11.prod.outlook.com (2603:10b6:303:9e::11) by BN6PR11MB3969.namprd11.prod.outlook.com (2603:10b6:405:77::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Tue, 24 May 2022 14:55:32 +0000 Received: from CO1PR11MB5009.namprd11.prod.outlook.com ([fe80::f538:5980:ef0d:b634]) by CO1PR11MB5009.namprd11.prod.outlook.com ([fe80::f538:5980:ef0d:b634%6]) with mapi id 15.20.5273.023; Tue, 24 May 2022 14:55:31 +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: AQHYbBe74aopJS6zVUCkbdrnTUtktq0t9cOAgAAtiTCAAABS0A== Date: Tue, 24 May 2022 14:55:31 +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: 3cddcd8a-615c-4231-9320-08da3d957341 x-ms-traffictypediagnostic: BN6PR11MB3969: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: cAXCMyZ7p/j4GV8UyAN5lgrJ+8e3DZlw9GhEux8+onaKu6aVQzRvdVTz7+odllKai4Ah+k0ONdiZ56JFbkD7Z4i8Q07H84oZYN9P2P/5PYCLf+Hied1gVh2DRgg9mBaAsq9Lv2dHNQGktNMttAPhwQHP5hkfTdCCE4UUY5bP3eLj8tMnIrmxLRCRb5Spxja2SOupgfJPXaZElzrhKUjslzl688oY9ad9KO+mls7BfteR443zDi6qqAMrK3vsouP/0h3ryyTVr+ahZ1PXiHoZlISoVypIn5ts0rBC77A/tw6UijnCNKlBxzXBR2zAv/v5f88jucy/T6q+50Y7zA7qXDJZVLfxQYFSjoI37Mz0d/B6l5vbbjW3RcMKe5f4gtiTnwSCsdfIiOYy54aPNuEHdUzlvN2EQKysyZ7gPVMsnubGjxTQRnGjf+zbwWZ8shxcDalcVQA2W2dYLGNcz5hEJ7AqbkUcqo1zR84ZmKv2aaoeln1D0zvN++9xR5iSKdkt6lWaLF++z1MIiZyzZHVeCrnHPJ0EC/EORBsONewpfbhfOjWk6pUcpSNd9flBoXYJTIhi5yuSbU81UZLuQebYfkpkUwfBOd3v5O2snGfwk5yYOY3NLdb9z4EdGYAOUNdlh6i99v5ALiQrLt6ql/3vClOQEkBxXFBPKUmOweMNgEW2IzwJr23nlNatSxc5oGS2VJrHGmHK5cy103hE4bYJIA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB5009.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(64756008)(107886003)(66446008)(66556008)(66476007)(66946007)(86362001)(76116006)(4326008)(186003)(82960400001)(38070700005)(83380400001)(5660300002)(2906002)(55016003)(8936002)(122000001)(38100700002)(52536014)(9686003)(26005)(7696005)(8676002)(6506007)(33656002)(71200400001)(508600001)(53546011)(54906003)(110136005)(316002)(2940100002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WvZXxSzHxkf0qm2YXqxE/rC/tr+LgKOn5bMdM1Rt9uoiKRqKWlI2WR/61wp1?= =?us-ascii?Q?wGWnadA9MM8BKBvZbaM0ar01V8Lqd/GSzatucYLsXeM9Gu/L1ov8jErRlHYu?= =?us-ascii?Q?2BKu3vH9/gu3SPGdA6G/K5FzmJF+Dsf2IcNWqZ2RIP38H+QtlEb443p49xxk?= =?us-ascii?Q?Wa5ER8BWotGvyAbSyJgHFiTJtmvHZbc2gLZnEwTnnyAQiougsSKNAAEShcET?= =?us-ascii?Q?4yvlfu7QhAGQG0lXebBtyux9avC+MC73oNLGl6GPRskYqXfOHJS0j4EGg4x5?= =?us-ascii?Q?yATujCLBhcvPuolWNvLm9V06JijpPM0aLlx1az+hUKdkIy51B17yzTiQTiGv?= =?us-ascii?Q?qG8k2OsWSjcnnd/nOfU1AIz3jYVtEmbOoyUo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AsbiFzVedQzQI7qoj+em1fEnAGntxFwP1Gi7be60dp9ADaSzNiy2CgJdLm?= =?us-ascii?Q?0LvTktMtw4WNYTJ9hLAExv0MXROIuwNtxOF4jIBSMXEG89mtFTH/yc19GORo?= =?us-ascii?Q?Qj1f6Lg+NOkRw6ljku4aDs5rfvmXifY2vv22yqATAGJRkUgop7ElivnAFkwi?= =?us-ascii?Q?RdhoSAAdP+H0uIKLOboHoCYihDxpvuewWkZYFHjEkJ8t4G2LyjMU/Lzi0O/6?= =?us-ascii?Q?Bp16hrJSMQzdfAMqeeqoxql9ieDnRdUhITLCJpl+rwadgo2fK5UK3KmKaw4n?= =?us-ascii?Q?35lCEPIaaooGgBEEkerciquOpWmPoetWpYd9nO5KEgwo822KNf34mRjRZlOA?= =?us-ascii?Q?Rqu1RLDrvg86RxzCkTfPch1UkqW4gQmLX0mQszAfZ4vEDXSKcoMxt8IHL/53?= =?us-ascii?Q?3PSj8A8Uh61JRq3dpOtQxpxjxQFfcl30m/jLxaLDMp+eN1yKOBRH4RxTM6q1?= =?us-ascii?Q?5OL9KOfAGkbWd6+7NNlyygrSUmdJSdM=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: CO1PR11MB5009.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3cddcd8a-615c-4231-9320-08da3d957341 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 14:55:31.8820 (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: rdc9C7EyuKE5XZSbVk4/DBaIEyfXqr8PISWi0mKe/aK0DTvzhx/Y/cOqJpwQ3v6xfhAYuUKQrIQs5BDZjlIuGlVmMAYZeB8bN0Suv2OwJzw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3969 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 24, 2022 4:52 PM > To: Akhil Goyal ; dev@dpdk.org > Cc: Anoob Joseph ; Zhang, Roy Fan > > Subject: RE: [EXT] [PATCH 20/40] cryptodev: add elliptic curve diffie hel= lman >=20 >=20 >=20 > > -----Original Message----- > > From: Akhil Goyal > > Sent: Tuesday, May 24, 2022 2:08 PM > > To: Kusztal, ArkadiuszX ; dev@dpdk.org > > Cc: Anoob Joseph ; Zhang, Roy Fan > > > > Subject: RE: [EXT] [PATCH 20/40] cryptodev: add elliptic curve diffie > > hellman > > > > > > > - added elliptic curve Diffie-Hellman parameters. > > > Point multiplication allows the user to process every phase of ECDH, > > > but for phase 1, user should not really care about the generator. > > > The user does not even need to know what the generator looks like, > > > therefore setting ec xform would make this work. > > > > > > Signed-off-by: Arek Kusztal > > > --- > > > lib/cryptodev/rte_crypto_asym.h | 34 > > > +++++++++++++++++++++------------- > > > 1 file changed, 21 insertions(+), 13 deletions(-) > > > > > > diff --git a/lib/cryptodev/rte_crypto_asym.h > > > b/lib/cryptodev/rte_crypto_asym.h index 52cb1c5c80..09edf2ac3d > > > 100644 > > > --- a/lib/cryptodev/rte_crypto_asym.h > > > +++ b/lib/cryptodev/rte_crypto_asym.h > > > @@ -82,8 +82,10 @@ enum rte_crypto_asym_xform_type { > > > /**< Modular Exponentiation */ > > > RTE_CRYPTO_ASYM_XFORM_ECDSA, > > > /**< Elliptic Curve Digital Signature Algorithm */ > > > - RTE_CRYPTO_ASYM_XFORM_ECPM > > > + RTE_CRYPTO_ASYM_XFORM_ECPM, > > > /**< Elliptic Curve Point Multiplication */ > > > + RTE_CRYPTO_ASYM_XFORM_ECDH > > > + /**< Elliptic Curve Diffie Hellman */ > > > }; > > Please add relevant information in "doc/guides/prog_guide/cryptodev_lib= .rst" > > > > > > > > /** > > > @@ -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, E= CDH_PARAM, x25519. For secp and Edwards/Montgomery it should be ok with cur= rent approach but for SM2 we may need new struct. > > Please be consistent in the comments for all params. > > > > > > > }; > > > > > > -- > > > 2.13.6