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 EDFEA45A76; Tue, 1 Oct 2024 09:57:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D22A4027A; Tue, 1 Oct 2024 09:57:54 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 505234026C for ; Tue, 1 Oct 2024 09:57:53 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4914V76S023268; Tue, 1 Oct 2024 00:57:52 -0700 Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2044.outbound.protection.outlook.com [104.47.74.44]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 41xf5m2x8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Oct 2024 00:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dqK+qEIqYwYMJKriSBZqnKZz8YCfV9V0lVxmCyqxePoelP3F9ueDTUEMCvnOnohAlkjrNsp6ib7EW2IeHuMX/U4W0/K+za/AdlSNmSXxaCV8i4zlpbrKiLARFEKKLoDZG+2PdQy6k6WUHWn3Ry7Ke4dzk+qp+ajVTmoB6kwHKbxfYtwoLlICs9aaUzoSLmUjey8tuNUF/FIPNlcQ1FSlsc8IbQGa2vV3TEfy2tmm7kTFHuyCJkN7/gWDluD9xTPpZE8ny9CmcYZNGuCGaWuJ4re+DukX2tm0Z81AfdV3xwGMy+k+p7A3vDaSuL+Z6Q2VTA/XjiDq+Ba2wIQQV64Lww== 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=4SA5/N2VfT32bgAI7l5nvmklWDR2UjrQ5m19BZdqRo8=; b=fpWKmA0B8uvTpJP73uQJIqM7UWC791gHdvgmyR3mm0hwEwgmVLc511tZG9v7/VqKwDbiQqY0F1+A1LWn7szg/MbdUVgm48I8SWtHRiTZ/+iDdHpH/dcuW8pIMeQL2sOa24PjGlAOduChqGII9HXZ76ApHLHFgyeKcCTormH7LYrMQHBVfKWVgZhBkIaYmSUJ5HiBiG+qqi5dOcAOP5BiXaPZXK84wkSkAUp7xho9SZdh04mrfjPOa7ZzpbSVy/Ka9CH5AwA6k/wgyG0mpiXM6q1S35u9RzZK4759PkxNLw+0yRyNrUfqOc9PJIe5s2UsCBu/NIkbX4Nc8gXjxul8BQ== 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=4SA5/N2VfT32bgAI7l5nvmklWDR2UjrQ5m19BZdqRo8=; b=tTHgNBPNFn14t4aH4YQQ7w6c8P1XYfjhDU6invVVauHAoN/sRJ+L+k8rLJeTK+Qr2g+2z/nLryoSXansbtTz1f0cFaqGSf++NplZYfyyzNzHnfd+eK0WFyHg7sAtVzEi9gQNla1A9T2i9/4X+ETQA5Eeb2xclH4X4uM+e8iXXVo= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by DM4PR18MB5027.namprd18.prod.outlook.com (2603:10b6:8:52::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.25; Tue, 1 Oct 2024 07:57:49 +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.8005.026; Tue, 1 Oct 2024 07:57:48 +0000 From: Akhil Goyal To: Arkadiusz Kusztal , "dev@dpdk.org" , Gowrishankar Muthukrishnan CC: "brian.dooley@intel.com" , Anoob Joseph 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+frgN4aps84kGIldD2qUm58bJxibaA Date: Tue, 1 Oct 2024 07:57:48 +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_|DM4PR18MB5027:EE_ x-ms-office365-filtering-correlation-id: 3cd0e770-9f58-49fe-eee6-08dce1eebe1e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?Jre2FjzeRPSqBn3t2Okru4/LRNLMwOm0VffXoAiyoY+bTLRdCosK2PvfOX31?= =?us-ascii?Q?NHH8R/q2kJLs0tyXB5ciG8QMZO5QMg42AqDkaFZf9ua97d7ASO/Q6wkctnS+?= =?us-ascii?Q?9N5M1BXV1LCb6fZ9mVE944qeOrVI9j+k11e5D+T3bhKO7I6KqrM/XvMhQXoM?= =?us-ascii?Q?2BGPl/ZskUpO5fqNW2S3ldraqk4h7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+QvXedZU5ccpgBwuQPPlb9Q9kGf4MkZ/Y25A/SuJwtuFXfhL7?= =?us-ascii?Q?hc5F+5+rMRGOIAhozbAmeM5M1q0ygmEwthEc+RQJq+uRPtoOuFJtwRoPGbgA?= =?us-ascii?Q?tHkDxTUbaaFz67CTZ3CZxGI0v8ckVhED3E7LgXfUt3W4oEMKI08MBmMmECuR?= =?us-ascii?Q?4gLcEa4iRvuAwspm7kcJ7/KJ5g6+0YvBJvdMKjJ4Vbdq4JbHvUU61yYmzFaO?= =?us-ascii?Q?dqIVZf+e7/b6D6H2mAPYQKatMT8s8pJd+5PnELlfUuLlU0mSLy4/GYnTPp2c?= =?us-ascii?Q?ccQ5CgzY2qcig4a24GZkKX1qUw9MFejw6ieoye/D02P29GDsxg=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)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qqq2oXgTix3yJEA2NmGYXo+TNYSnkGewZ+FtaXeeHMrptrAtlKbD6E1Hm2Ze?= =?us-ascii?Q?WYocX0ItcBxclSz/4La4MP1F8a1XZUki+dqkbeX0+tJS/jtDMyq8MwiHcQSS?= =?us-ascii?Q?XoXaF8iv2aqB/3ZHULLJFL7QLwB+U5cWqMuCL90f1WSRn069CkZ2jlPjv2UJ?= =?us-ascii?Q?twq+Ie+HATkIrPk+cDEttUCCRgjJ3AqyuxqAkUDEtfWpj/9G3P7uYgH7mnCG?= =?us-ascii?Q?9K4kgwcc39r6pLDpLN4/o1emv1InHSOQmsjhtetBHXh6VbkQl7ro9QbAnDNX?= =?us-ascii?Q?SfXKB2hukXGpS45uXiJFQN3iaPlpE7akNcdq4S7h5QWQztU5M7R7KcPHjzyZ?= =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MhRdQUZjPkky0yvjIrmGS?= =?us-ascii?Q?i3BdlUtkLV9xbrdS3QD53nhvm6N3n+Pb2l8AuLNLpln/xFB040D3yy+RM4nW?= =?us-ascii?Q?dDicyKGLYVubaULhiA+SlxuIvjlR4HdOm3aH1N0KnUR8VmoPiLcaRmdokvJ4?= =?us-ascii?Q?UxVd7oN8GdRy9Dv0AeO8F+PAoWaYljghH5nUDW7l3PZSSMCEoxxaQmJbKmvd?= =?us-ascii?Q?QJ2eSh7ZSwdzydSHJ7fAlLiKxPdhl/dMpDBGTY5bLZ98JoIrGUsp6wdDaP3l?= =?us-ascii?Q?6xJ2+w0xDtVqyJstFl6f86li3qjqh7iJvLvCCZi8jiCiCF6UlDzupLTIfFvK?= =?us-ascii?Q?1rL23uBrnx2QbR6jQzw=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: 3cd0e770-9f58-49fe-eee6-08dce1eebe1e X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2024 07:57:48.7858 (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: esvGejyDI7qp8WkIP2+RU/5wQ3kZzhP3ZmXGrhcz3kdkLW8BQMmb9ofh+OiABJMziRAJi33uGEFQdV0dfer22w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR18MB5027 X-Proofpoint-ORIG-GUID: zgKidJV1VggWO2Z2Dum-M1kbga-QnTmf X-Proofpoint-GUID: zgKidJV1VggWO2Z2Dum-M1kbga-QnTmf 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 | 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. > - */ > - }; > -}; Above change seems unnecessary. > - > -/** > * 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 > /** > + * 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