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 4C0C745AF8; Wed, 9 Oct 2024 22:51:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF5524029A; Wed, 9 Oct 2024 22:51:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id AB6C64025C for ; Wed, 9 Oct 2024 22:51:42 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 499GeQKe006361; Wed, 9 Oct 2024 13:51:42 -0700 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2171.outbound.protection.outlook.com [104.47.58.171]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 425ats2rtk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Oct 2024 13:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WPUxWp90yH4Wl9iMzqxl12vY6GMZgik/0kbh5H27xEMAc6qnkTDo+xlXEu//ybkWGpqGgPfx3jHOcGxOVi0wvCapU+D/tPELKjdH1dZhC7Uj1xLcOWF1nOASLTnM2zfcSL/h2ec/24CZ8u9aXhdlccZDVcxyWY/0P6O3lNj8s+SYzn6gWGLwXwuWSeyYr8QyZUOo64tWMn4YY9qb9/M8gq30kxF8WJ5rxrmkRkCe5RTQTZwx7czPeuBBbh3KHwZIdyECmRP7JysHZbWlfm59OWrK3huzB41/AGt2AIE49o1M6L3VN22IAT8EJoQDD5kuwGTqit29ZUCmTBiY5L9yHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=IXnoV8cA+2DRi8Jjme40X2/utebh2H8eGA9HXDk3hLA=; b=Zpr79gM0CuwK8+9Kj8wOu3mtc10xW3/UfdVwlrUUTabTjcquWyv6rmvfTaRTPLPh1ZXj32oeHnpYP2lhcmMKx5bZ/xXIBNlrnOC3+tksmVSGccF6FjHUsU4VmjWsqhMVy5iRd0EwuHuYoxafMUuEVTGIyQFl3BsyTaaJD7sTCZl3XCrAXdJhkAY/acZxsR1qsFgzmyln9PqRPszsT5rtioPvXpf6ghHwBNHvmJW6i19tz4zsc3V72xvND0JFEC9FmiCnF6cqJc/0aQ9/2JRYj9CbJvZmxAsvSHQRPk3nfleGXmTdZqdsHWlV0KWoq+mmdIjbmBDzD6cZHTL79rhWVA== 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.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IXnoV8cA+2DRi8Jjme40X2/utebh2H8eGA9HXDk3hLA=; b=qbehLaeZygVglr5c8SX7uDFQjbxZ8gJ8UALz1GmvorOGIKZLoNXzjfp0y64TwUu7XsvdYqJ/eNXMZhkUvqeViurRIf+2l4cWOy9LQyeAecHaO45QAW0Ci3RctYe6HG3ezpiWdXYiLJowXHnB9hCW59I+HcFDZ3tz9TghGEbt1Ng= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by DS0PR18MB5366.namprd18.prod.outlook.com (2603:10b6:8:12c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Wed, 9 Oct 2024 20:51:39 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d%5]) with mapi id 15.20.8048.013; Wed, 9 Oct 2024 20:51:38 +0000 From: Akhil Goyal To: Arkadiusz Kusztal , "dev@dpdk.org" CC: "brian.dooley@intel.com" Subject: RE: [EXTERNAL] [PATCH v5 2/4] cryptodev: add ec points to sm2 op Thread-Topic: [EXTERNAL] [PATCH v5 2/4] cryptodev: add ec points to sm2 op Thread-Index: AQHbGlXlN+/yktA7j0SKbKE3FMl6ALJ+5MLA Date: Wed, 9 Oct 2024 20:51:38 +0000 Message-ID: References: <20241008181433.57591-3-arkadiuszx.kusztal@intel.com> <20241009130147.38280-1-arkadiuszx.kusztal@intel.com> <20241009130147.38280-3-arkadiuszx.kusztal@intel.com> In-Reply-To: <20241009130147.38280-3-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-traffictypediagnostic: CO6PR18MB4484:EE_|DS0PR18MB5366:EE_ x-ms-office365-filtering-correlation-id: 053aab8f-658f-4c60-920e-08dce8a42bd5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?xR82ydH2ykNN8B65icqEaQ66s8RZNh02Gx8v41KJsPqH9dBWcMqtOvQOW3Ni?= =?us-ascii?Q?xivAY/FAQXwStbcLDPuEdix7mx1fB9yOW4dEy5O2sgRHd8haWTRvjl59+wp0?= =?us-ascii?Q?D6zcJDA8KHnl+SN7RSJv9lXK3kGYa9boiXK3mJeJpKHIv8x0nkagA1fAlyA1?= =?us-ascii?Q?BtUOQufj04Ey/EJpW2okgfQMqom63mdnobmLqLCNvwXZvZ/Y+tkl7y+N0i08?= =?us-ascii?Q?qDej2shXj2RrUji3SyLFyw1QLTZK71pO8rFCpisDnqkztT4ibAQhIMuUu0zz?= =?us-ascii?Q?4U+97zmY0eFT/ezy1ehe6onukZg88GHsTakMQ5QjjP1ue3MS9njgLTqddxbZ?= =?us-ascii?Q?vaRg+U6ivQS6DDlngDHm8uAfsZ6lBYNUnboVjJrMpveLu3Zfjp2qvpgBa92M?= =?us-ascii?Q?JURvPIht0imNQNb2B57twvAwxpu5f4BoR3C9CuKDrmAXGehiRIgxgKbh1sVy?= =?us-ascii?Q?ljqKnaVH02xGmBDvaxzc0/FkJeoBnMmbDWMXDPA+8AdZfgCTVVSsqzGY011k?= =?us-ascii?Q?ZA8/uTSua/+UosaMC3Gp3E56u+Hacp+EvL3jtFvaQ3QmUQHRho/seR+0dl10?= =?us-ascii?Q?PHZDU3ekopocLbF62vBu6TAvlIz0XfSu8E4hU538juvjffSFs650H9teNMFv?= =?us-ascii?Q?qH1urZAkZEo9nHpqCQL+hT1Bnt2gr1etBw50E4F2bPJJ5KlRPUIjL/Djj1o1?= =?us-ascii?Q?aQF7pPKYViYGlxQaw/zR8nzL6KIIPxggHg7yQHizvzTJm62+8wnBdU9KHrDC?= =?us-ascii?Q?bH9p6swdfnh7Mq1VQXEBtlfWwQ8O/onk1a8tDr/d/9p0QX54XMquC4RgKp2I?= =?us-ascii?Q?wvWAHM70FtEQSmuB2qgAz7IrIe8nXI7G5fSxQHeEdqM3i8f55EPNEdhWLhJ5?= =?us-ascii?Q?PNq9A22cdxS163sJGVox3m7QAC6RyUZszkBxeH6QuaBsvLwVhXER6WNMYq81?= =?us-ascii?Q?dcHkrncTnjPnhtzSK88Ds663v/+i21v9gQinz0MLhCVcw/Ns97mq0NuL1iOI?= =?us-ascii?Q?hEHznFYfCHiiWYx3RXsv9iuhbYYnyANJtHadHlyEwa030Fm247E25otmNhpx?= =?us-ascii?Q?N9GWlqi7q3ZE7qeZnydDJJUZ+ALkzR6ylIJTh8DeE7ILtlouvHKK6kihZDdv?= =?us-ascii?Q?syhhd22hviAAPSxGL3sO/BjWMSx+Lrys6yBkAzJI4B1rf44bXWTwq0Hpsk60?= =?us-ascii?Q?ieqQmDouh2vWh71MAHHtGw8pMwKMzBSKL+6+lD/pa78dLh455IUHyrbeqJfi?= =?us-ascii?Q?TGp3TY2ogSMzcu6SwZWWFTwF2UV545BCJB5S/Z2bczg2SkAC+Uu06xWT+E2A?= =?us-ascii?Q?pkcDd64Kw9aT/y8JlMRnHAWyWKr9Gr/tjxDkgSQ8XM5PiQ=3D=3D?= 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:(13230040)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7JakqiAMMVzs3ROE5buAtzcyEgZi+AWS5kpBJjXQ10E4V/2i+sam3G7Gxbnw?= =?us-ascii?Q?vYZQLRdfHWGKoagsKdX9pEE4cHhVoWVdQFlBLq1fna98f8amEevYdC7BVyXB?= =?us-ascii?Q?AYEWurE+ZpLnbtyn7EoSxKq70pEsQi6wFXv3Eu4yAo1zC8nNl1JlQlzH/6Jm?= =?us-ascii?Q?e59TXd6iK45zZ4yVI9+0GeSYCBM1A7iv/PfY2uStmZ0tztFCNhnKyjB+Sgi5?= =?us-ascii?Q?Q/ztvHE0+6VjwLVnlxB4UofhQb0tw/PKJ4dVCIfuxPc3aUvfdmXKoLHKgh7W?= =?us-ascii?Q?ZCFO97M6McYEDpz9CB73i1eTRqFeaTgXPA342Pmgm+9VAHuOSMJMMgqSBqI5?= =?us-ascii?Q?C62H8J86AgrPsQYTjhmLCkKmDHLt/vgA4msIZ1jXrvLbP68MEMTqibL5CmM6?= =?us-ascii?Q?j2t1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v3xQZlJiyNKNpQFcm?= =?us-ascii?Q?aeePdLgBCUjOcAonzH42RavK5rVsVGP2Ms8bZtHDtDwDU0jXrPr4eShc1+v6?= =?us-ascii?Q?SRRNv4w/xRaBL/XV5gQ0LiZDGu4VCN5JzKj2BNeCpC6nTv7I8o8wQf4ILyO2?= =?us-ascii?Q?UdfxSzg+PRWWAhBznQyz4kJv0YmRfItwALP0f8uLYiVCErvRQsBgYUI34g9o?= =?us-ascii?Q?Cv9tQXtQHleZsnqB3V7rUkOOK1Tr5fWwEulfALx6bSWdgDBMocr0VnAtROQ8?= =?us-ascii?Q?ASTQUfNFrCc6LCCiRoMUy3FgvQ7+nBeStzZ5skgb?= 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: 053aab8f-658f-4c60-920e-08dce8a42bd5 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2024 20:51:38.7108 (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: s2j4BMMXORObNU1A97Ii+2loywbMTZjyFR+yrqUxIxOc5+V+QSD3FC+XTf7XorVJcbk1kMkm2C1AIA1xEifwPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR18MB5366 X-Proofpoint-GUID: 89h7n2CSe8UqbsHY3zXp9EHcUEmIALqt X-Proofpoint-ORIG-GUID: 89h7n2CSe8UqbsHY3zXp9EHcUEmIALqt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_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 > In the case when PMD cannot support the full process of the SM2, > but elliptic curve computation only, additional fields > are needed to handle such a case. >=20 > Points C1, kP therefore were added to the SM2 crypto operation struct. >=20 > Signed-off-by: Arkadiusz Kusztal > --- > lib/cryptodev/rte_crypto_asym.h | 53 ++++++++++++++++++++++++++++++-----= - > ----- > 1 file changed, 39 insertions(+), 14 deletions(-) >=20 > diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_a= sym.h > index 2af6a307f6..65b1a081b1 100644 > --- a/lib/cryptodev/rte_crypto_asym.h > +++ b/lib/cryptodev/rte_crypto_asym.h > @@ -607,6 +607,8 @@ enum rte_crypto_sm2_op_capa { > /**< Random number generator supported in SM2 ops. */ > RTE_CRYPTO_SM2_PH, > /**< Prehash message before crypto op. */ > + RTE_CRYPTO_SM2_PARTIAL, > + /**< Calculate elliptic curve points only. */ > }; >=20 > /** > @@ -634,20 +636,43 @@ struct rte_crypto_sm2_op_param { > * will be overwritten by the PMD with the decrypted length. > */ >=20 > - rte_crypto_param cipher; > - /**< > - * Pointer to input data > - * - to be decrypted for SM2 private decrypt. > - * > - * Pointer to output data > - * - for SM2 public encrypt. > - * In this case the underlying array should have been allocated > - * with enough memory to hold ciphertext output (at least X bytes > - * for prime field curve of N bytes and for message M bytes, > - * where X =3D (C1 || C2 || C3) and computed based on SM2 RFC as > - * C1 (1 + N + N), C2 =3D M, C3 =3D N. The cipher.length field will > - * be overwritten by the PMD with the encrypted length. > - */ > + union { > + rte_crypto_param cipher; > + /**< > + * Pointer to input data > + * - to be decrypted for SM2 private decrypt. > + * > + * Pointer to output data > + * - for SM2 public encrypt. > + * In this case the underlying array should have been allocated > + * with enough memory to hold ciphertext output (at least X > bytes > + * for prime field curve of N bytes and for message M bytes, > + * where X =3D (C1 || C2 || C3) and computed based on SM2 RFC > as > + * C1 (1 + N + N), C2 =3D M, C3 =3D N. The cipher.length field will > + * be overwritten by the PMD with the encrypted length. > + */ > + struct { > + struct rte_crypto_ec_point C1; > + /**< > + * This field is used only when PMD does not support the > full > + * process of the SM2 encryption/decryption, but the > elliptic > + * curve part only. > + * > + * In the case of encryption, it is an output - point C1 =3D > (x1,y1). > + * In the case of decryption, if is an input - point C1 =3D > (x1,y1) > + * > + */ > + struct rte_crypto_ec_point kP; > + /**< > + * This field is used only when PMD does not support the > full > + * process of the SM2 encryption/decryption, but the > elliptic > + * curve part only. > + * > + * It is an output in the encryption case, it is a point > + * [k]P =3D (x2,y2) > + */ Please add reference to RTE_CRYPTO_SM2_PARTIAL in the comments. > + }; > + }; >=20 > rte_crypto_uint id; > /**< The SM2 id used by signer and verifier. */ > -- > 2.13.6