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 C5B6B45AA0; Thu, 3 Oct 2024 16:39:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 764714025E; Thu, 3 Oct 2024 16:39:25 +0200 (CEST) Received: from mx0a-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 83C394014F for ; Thu, 3 Oct 2024 16:39:23 +0200 (CEST) Received: from pps.filterd (m0431384.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 492I1w7E004035; Thu, 3 Oct 2024 07:39:22 -0700 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2175.outbound.protection.outlook.com [104.47.55.175]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 421b3g1w84-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Oct 2024 07:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p+SHvsSMY5wC6tiM/KEkWYiFceBo4Lf381g7kGQlIVUEXLoq8njNUq5AxbRkBI/qqzWPOglD8oRaxxQ4SLazXx1FeFDGzZa76auOteSgju2dG87bxQadSLVCF/BkRQ5xUvvCkEKUH8mjfClw3WkbkqmYKNqqUVeVlMmR6wj93y6cFiuWWgBGcgMpti8nLFwUZxUGllUIDUiEh0ctPQ+3GME2Xlw2IC8EzpeKCsKHG/6SZH1RCLiXj9CbswLSQyG25PFhqIDReXeqmi4SIlnFNinjJouygr8A8I8ugbQ4PSW7Y+wAG7iaOgpYxJsKPtIxnSlBUAW7WtQlEj8ytaENQA== 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=wLqheB+S9+o5xyGYCLoAEj1ubWfuLvV4PMTQEquU2SU=; b=OUTeJPsc09a/vtxlL6SIRqnZLe6LG7mMF7D8fUxzvRhSJT3O0VlI5mWZmqYuUj4G2Z01N0XZ0+I3jXscVeqoqkqH5+Z7sv/BQrJwhrwoGTsioiC/GQWA24nxqpScIetVV5Qiw71ywCtj/kF7NYW4m1hrMUv4K356y7PVSN/XYYLol+ImA2FY+LcfWiIQqkRPvQxEtFu2SlaQGew/oxZjWNGFxjzSVH77sBgFH4ChZXSr0CMPS3+L3j9TnR4im+tEz915QV+8h0J3Vf3uyHRshQVCPAJbJW5dgw/lIFYPAfc45IStP5uXnA//Z47QiYAHix6NdZJXwpQi+ZmvQpYJoA== 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=wLqheB+S9+o5xyGYCLoAEj1ubWfuLvV4PMTQEquU2SU=; b=aJkygHZhrFV+s33xyGBPg+ulNpacSZeLgr76zpzDFk/nj4Uyp/DiJ4+RTBnPJ/TtJG3syJXHIkNMgk28sikvB2QE2GTBkE31XhmdiuDwJjSO4VN7IOka/EMSZfi+86t6NCBBehl8Xu3yT7P7gPdjqJzxPd1+tHSZKTBD14Y5zIg= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by MN2PR18MB3496.namprd18.prod.outlook.com (2603:10b6:208:269::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18; Thu, 3 Oct 2024 14:39:17 +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.8026.017; Thu, 3 Oct 2024 14:39:16 +0000 From: Akhil Goyal To: Arkadiusz Kusztal , "dev@dpdk.org" CC: "brian.dooley@intel.com" Subject: RE: [EXTERNAL] [PATCH v2] cryptodev: add ec points to sm2 op Thread-Topic: [EXTERNAL] [PATCH v2] cryptodev: add ec points to sm2 op Thread-Index: AQHbEp+frgN4aps84kGIldD2qUm58bJ1HEvw Date: Thu, 3 Oct 2024 14:39:16 +0000 Message-ID: References: <20240129185950.14346-1-arkadiuszx.kusztal@intel.com> <20240929172912.87859-1-arkadiuszx.kusztal@intel.com> In-Reply-To: <20240929172912.87859-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-traffictypediagnostic: CO6PR18MB4484:EE_|MN2PR18MB3496:EE_ x-ms-office365-filtering-correlation-id: 99367ace-8652-44d3-3ecd-08dce3b92887 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?fqC7zltQWP6tlguTneel6nnyX+pNqKkeel9apX0IhXZWsZbZtSL2qJpPPoRO?= =?us-ascii?Q?fNvlyhG7a1mYpTF84r7jDW36X7T/PqoGEjgm5uaXafHQBnX/6WrgmIT0ctb8?= =?us-ascii?Q?KptBvT/7u889CSNw7lh5sLAH4DOyrFOV753vK3YJiEA4YHX47Yiu/j0EuOwz?= =?us-ascii?Q?my34KJ4NVmPEfcBFslP/7ayeeiKYzdp/zNqWmHsxpkVnMCX4tzDJNzeLv8Db?= =?us-ascii?Q?fJI4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M1?= =?us-ascii?Q?IT1LcvobIDFVz1nKe8HEJ0EJ5G/FD4OlnOyLeckhNkhSiEwXP1X0l7AHPT37?= =?us-ascii?Q?f5gbJSBC4LRgDzNiVa5YqtAocfi6ZP4fMxuTyWIjA/sCSzVsgf2InLW+ZBbc?= =?us-ascii?Q?cNELcpybm8ioi0eAk9IHC9hO7XwcL2BUg+ku5A04G8dHOIbjwWjmjmS+sXE3?= =?us-ascii?Q?X+nphQbZNVZYgFXwUpw4z4UCPcnIfDTs2Ut0RUwiWx9cWw=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)(376014)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?S1NwDXF+YmxAknCUm9dwffShSzN/qsxR9ZTXxJ+YCgsS5TNnDMNKaPbLGuGA?= =?us-ascii?Q?yWr/hXV+5D89580gSh7YBjGV2q8IO1WYzCnjBFXLb+hhuwbv8HuL0rbyDSh5?= =?us-ascii?Q?o77fmA/dUHWGzukFpBdjC02EyS2tabTQbLtBtD8kF59jDUEnRQuYkIr6GM8o?= =?us-ascii?Q?z1Dopd/TW9p3BtFLZJFq/rbyvt5JdvGxo+Hlg8yszx03pDA9i+5bPvIFmdsy?= =?us-ascii?Q?KxJz6HLu3/t1yoJF//fakmVr4O5mrtMg7qeJ0hBkUDF6jmC4OKiYU77PeVt2?= =?us-ascii?Q?+aUI6T8U7I97+TapUW8XZhUg5ocTa4KICCld1oIQkGOJAI97sJcLFxqABVZh?= =?us-ascii?Q?a2cLAERR8xA3Lt2f1E16isiYLI2NJ6b/xOfP6Y6fABO8KW9C1WcGlw0rzMW4?= =?us-ascii?Q?vL3dhgqZTEmGR+NzXxE0rZiEioiJBA+YkKW89xsVxitKj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BjAlYwWtTWv+HCOTKtqoXX+3ZhXxp/cs2U/1Bt96Kmq6YDWn/LBRG9lUT2?= =?us-ascii?Q?Cc1vkp2N2gN1atR+aIhPIQYrZUpqJ9aY4t8QqFtPviEYWQOTmVKRl6vheuJb?= =?us-ascii?Q?L2zl0iUmq1OESTe1IWw4/ITDNIimk4VzuduVXn/p2AbDV0Dcvs5rYSh47VDj?= =?us-ascii?Q?+hyXY7Wr4lOJkwirB1C9cc0BWR2ivWby2LlMjUEzccr/wvS67jmqDvJ8tUaz?= =?us-ascii?Q?b/rlNagkMc1XeVRMU3A=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: 99367ace-8652-44d3-3ecd-08dce3b92887 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2024 14:39:16.7786 (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: B8BIj+0UEiRD9mbCvEirLVwcrl7Jb/Cf3N05/SBJBfI1icUgy3J1r6It+x/E08qO/EPeQ/rHE3rsD42KB2y/Nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3496 X-Proofpoint-ORIG-GUID: r_yUBsZ41dz2wk3A6EFEs4pqeR7Dw7B4 X-Proofpoint-GUID: r_yUBsZ41dz2wk3A6EFEs4pqeR7Dw7B4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_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 | 119 ++++++++++++++++++++++++----------= --- > --- > 1 file changed, 71 insertions(+), 48 deletions(-) >=20 > diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_a= sym.h > index 39d3da3952..f59759062f 100644 > --- a/lib/cryptodev/rte_crypto_asym.h > +++ b/lib/cryptodev/rte_crypto_asym.h > @@ -600,40 +600,6 @@ struct rte_crypto_ecpm_op_param { > }; >=20 > /** > - * Asymmetric crypto transform data > - * > - * Structure describing asym xforms. > - */ > -struct rte_crypto_asym_xform { > - struct rte_crypto_asym_xform *next; > - /**< Pointer to next xform to set up xform chain.*/ > - enum rte_crypto_asym_xform_type xform_type; > - /**< Asymmetric crypto transform */ > - > - union { > - struct rte_crypto_rsa_xform rsa; > - /**< RSA xform parameters */ > - > - struct rte_crypto_modex_xform modex; > - /**< Modular Exponentiation xform parameters */ > - > - struct rte_crypto_modinv_xform modinv; > - /**< Modular Multiplicative Inverse xform parameters */ > - > - struct rte_crypto_dh_xform dh; > - /**< DH xform parameters */ > - > - struct rte_crypto_dsa_xform dsa; > - /**< DSA xform parameters */ > - > - struct rte_crypto_ec_xform ec; > - /**< EC xform parameters, used by elliptic curve based > - * operations. > - */ > - }; > -}; > - > -/** > * SM2 operation params. > */ > struct rte_crypto_sm2_op_param { > @@ -658,20 +624,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) > + */ > + }; > + }; >=20 > rte_crypto_uint id; > /**< The SM2 id used by signer and verifier. */ > @@ -698,6 +687,40 @@ struct rte_crypto_sm2_op_param { > }; >=20 How is the application supposed to know, it need to fill these parameters a= nd PMD does not support full operation? Can we add some capability checks? Also send the patches for test case and PMD support. > /** > + * Asymmetric crypto transform data > + * > + * Structure describing asym xforms. > + */ > +struct rte_crypto_asym_xform { > + struct rte_crypto_asym_xform *next; > + /**< Pointer to next xform to set up xform chain.*/ > + enum rte_crypto_asym_xform_type xform_type; > + /**< Asymmetric crypto transform */ > + > + union { > + struct rte_crypto_rsa_xform rsa; > + /**< RSA xform parameters */ > + > + struct rte_crypto_modex_xform modex; > + /**< Modular Exponentiation xform parameters */ > + > + struct rte_crypto_modinv_xform modinv; > + /**< Modular Multiplicative Inverse xform parameters */ > + > + struct rte_crypto_dh_xform dh; > + /**< DH xform parameters */ > + > + struct rte_crypto_dsa_xform dsa; > + /**< DSA xform parameters */ > + > + struct rte_crypto_ec_xform ec; > + /**< EC xform parameters, used by elliptic curve based > + * operations. > + */ > + }; > +}; > + > +/** > * Asymmetric Cryptographic Operation. > * > * Structure describing asymmetric crypto operation params. > -- > 2.13.6