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 625C745C93; Wed, 6 Nov 2024 11:09:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 031E3402C3; Wed, 6 Nov 2024 11:09:05 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id DC1E040265 for ; Wed, 6 Nov 2024 11:09:02 +0100 (CET) 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 4A64JulA026189; Wed, 6 Nov 2024 02:09:02 -0800 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 42r1b20mt5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Nov 2024 02:09:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pfdH5QJrW4HQgdA6asplLraBBxIpoxPyKSj6Rv7sHqR/lqbBIOC1FeFWdY4lVJ3YESbnK2eHGmQWTJlrUWIXDaY7cV3x9cr5iZBH6+Yau6LP+ml587ZToESxgu3MqazHo1nI9lLd9ViMbu6t3BRpPdRyMl7tCz9EACtl0LvnuqyCWnCRqI9UJQ/Fwp6Kr2c5WNluv7V4cX07olGLtqBFH6ufYP4W5KDPBZ6nM7VSvTwMeX+aWko6NthOSHAjsyr4txPfGAGF5BleMKVEU3CJOV82wy5exVe4BF/MP08N3shTNhDOtmGC9fpryZnnWQTnYwvnj84sLLD+9if2/Onn8g== 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=Ae/oJl0LT+PCkR+Jgr2l9PHd+wsfXZyf6boN407PmJ4=; b=GSgmM+GqA3yFNYSePTaGoFN+mOl/VasDXnuEbIyf9ZmWB6i3G3bn0AAc4Nw5rf8C3uc40hH0d2nRcBI0OouJ0vVvD2z7bW36Ax9ZrreJLMnI0FbBqHNiztoTkg8aZwnosYYZ2SNC7AIFgSc9+q9Ee/VsoLSUHj1cT74HpoIFo4abHuYevUgWxx50aQBhRh+lR6i/CiAK3r1Wa3WLHcU4dceguycgftKpTxFTj2BdY5rnhHFgc+r4YG3QZXEs0qY8cX/vPX0kuN8/DxhnoPqoEqhrD06F360bEPfiLGc/a4JLBJI/7Uf3VUQHhkcVFUc/3BnwsuK2RTPRqvpialnovQ== 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=Ae/oJl0LT+PCkR+Jgr2l9PHd+wsfXZyf6boN407PmJ4=; b=Cg+WIyDGCTzuQU3R+u4rZUGDuasqsoPH83caoHY8xrD/fQ+Onnn5rk68/JAO8h23Bu9GJHvgIHTtc8l2wgLiKS60TP7Jug+Xerlz0+lrQvuuu6DknL3OMJXpeWtUN8laOiFKlfXwX2B5X3vroEgqudJ+RchV5J5W33BVBCuiQl8= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by SA0PR18MB3696.namprd18.prod.outlook.com (2603:10b6:806:73::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Wed, 6 Nov 2024 10:08:58 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d%4]) with mapi id 15.20.8114.028; Wed, 6 Nov 2024 10:08:57 +0000 From: Akhil Goyal To: Arkadiusz Kusztal , "dev@dpdk.org" CC: "brian.dooley@intel.com" Subject: RE: [EXTERNAL] [PATCH v8 1/3] cryptodev: add ec points to sm2 op Thread-Topic: [EXTERNAL] [PATCH v8 1/3] cryptodev: add ec points to sm2 op Thread-Index: AQHbLp0Cxn0a356xnEyVVJ1e4suvK7KqCkOg Date: Wed, 6 Nov 2024 10:08:57 +0000 Message-ID: References: <20241104093610.20426-1-arkadiuszx.kusztal@intel.com> <20241104093610.20426-2-arkadiuszx.kusztal@intel.com> In-Reply-To: <20241104093610.20426-2-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_|SA0PR18MB3696:EE_ x-ms-office365-filtering-correlation-id: 2aab1e93-6247-46c4-726a-08dcfe4b0762 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?dpeAaf9xuUXfK7wsD5bUYtHnv8eCs1UMIQoK9cYDe3s0SmrarOgi1bO6WqQb?= =?us-ascii?Q?CGFSggYiEqe+oQYmO74PHyO94kqz1TGzVxk9eoxKUg87QGiJ/A7s9It6RWRb?= =?us-ascii?Q?k1ZzSFcyXVELqrmli8OK8ET7WdQTMSieThHM6lAK7vkhUjSQzigxmeWzFUh2?= =?us-ascii?Q?ve08Pjz1OMAprzd548GgIo98om1u97EMe/91dHOq9oNUkTfuNIO+y18gsH7s?=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aIyvawaM1KVDTaciypNUek7+P0sYICY6?= =?us-ascii?Q?4N2gve2TunUiyQD8FCVm8kr9uYG0725xKk/0F+i3kwrbkn4kWm1wYo4NQVNQ?= =?us-ascii?Q?OeW1yImo2jEYRHYAV95xDSaOGaDQrpdz1vKzMbzX1PR+RNUaVvdtx3lV9CDJ?= =?us-ascii?Q?l7xvGIjSdDZNSqhhBdwb6cgsgBfxI3qDOP3G6Kxs863Bjgtd+RR7l+8V4TVU?= =?us-ascii?Q?1oL9NlkI4B4cc3NAbSls9EAiDGMUNIH4Lc4xDIuNtHGYol+gTSf2jTIsgQ25?= =?us-ascii?Q?T+5aNRg=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)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5q+Vg+rleqqjX4fkcB9qyBfnzX/Mx4biS0jXiW3YfUMxVp3VZyxwpJ+vKHzA?= =?us-ascii?Q?1mUtwcd95gOpmaCf8FBouffknKnAZS/zF9HBYEB0qcqDEsUwVWllXAR9pKMo?= =?us-ascii?Q?mEyzGA+n/sUtExxz74/kmOG5HDD4R1KjJoL/YypntgHZV5vpru+CdjfAcSqQ?= =?us-ascii?Q?3FVmq2MRbGgAfnSR5tveynizSf99NE2gs48dH+ivhVElfCTQwkYTT3L+5Tye?= =?us-ascii?Q?1a2XutVIYbyYSmJnptDQdiTpWB+a9uMWUUBcRRGtR8GDwSUprtnvUaMAtKLb?= =?us-ascii?Q?7Mo3AzvOb26twSdLh8LT888HqqcuOmjy3XK3ZjJwGRm+azyyJu6ZvSEnCxFL?= =?us-ascii?Q?CE7jiHYkF5twzIpRbzLfWp5ULu6KNAzv4ZP+CwfbC7/XqCnb+G6XEtkiWV9x?= =?us-ascii?Q?AVMq510l7D171LdSmul00yOyCP8gNVA5clFwIqhPgr+EV+K5T0MwyEDIcOHI?= =?us-ascii?Q?F/DUi35XvoEBaMIC7KbV0hBTrtHujLa9klZwxhgxHtjdMO7bZ0+WUZljJjl6?= =?us-ascii?Q?0MgqH6HCcT3sR0az1bgrid53NKTph39badpO4Nt7rGC9UTP7YqFeFDum6Xlr?= =?us-ascii?Q?mv7ci1/wKb4nqJtz1v+h10iM8FCpD0His+mU7atGNVtbtTie7Mg3yNbjw9lr?= =?us-ascii?Q?x6li3bgSzxW4EPaag2cVNphDc/WImCh7J2mFpXRxXPVNDUjrJ/chLZvccq/I?= =?us-ascii?Q?FHzL9p1RPHRqJmbJybafKAmKVaqYISi3za44BDng1CChns3E4+c+BL6ii8Ow?= =?us-ascii?Q?17KlghtMhW26MGsxeWlZ56I94Mw1f+65paizKL2XopsY/bKmb5n/Rj1Ob9pv?= =?us-ascii?Q?b7HgQF+14AQ86BCEwBdVW+ymMTQntcngNbLNu5AJW3n6Xrc3JWI+IGwhwaAG?= =?us-ascii?Q?f9kNSl4TKsPVh0M+m1POCK2X5i2vadZCkls0HO/snR7TWFEUh8BtmcBsM5+D?= =?us-ascii?Q?TDrRz9wRU8y3X38/19UVyRnSGxaL/xLBdOAvGGIhYadeZZaoYxtbnXEvCb/o?= =?us-ascii?Q?m2Ua6RrGaeX+pl557mvVCPzYQozEeQvaqZKddNqTGSsDRuoGVq3ynat3UpTc?= =?us-ascii?Q?DZxOPuiXBbco2LS9175QfN04dh+f7qpOWuP3qua1Eat0thm1UFh2wMaH+8A3?= =?us-ascii?Q?FhMSPgE46e9+3G2mqTSHqOmew4z7H5ertwOpzxjjH3Y4PWObySznQ9tN9ixe?= =?us-ascii?Q?DxCLclEExr1EM6on7R9f/8uyi4CI+ls0MZ0vLzof3X9WSWO0KtktVLAgFwfM?= =?us-ascii?Q?vWm49ciDDj6gGJoAz6N6sQ5NFy29k1egOw3d5HPD0SrlDDoyL4b9vAAfj65w?= =?us-ascii?Q?o9+zOxJv09sqZExczQDD549mCw7eNrxePZ81oKH520SgFwJkT6yp6VIK2Rcb?= =?us-ascii?Q?Txc2hPNY2sPorOOJqkNtiAEFX60z1ptx73aeWPf+Qgij+PAcIN8OMqk6Eawf?= =?us-ascii?Q?WIvtBoSUoO18j8wYyG3pZQspmBof/i2XMrt/k4b9uIR4v3gxQHrSB6NxqZFO?= =?us-ascii?Q?I+59taEUNr7b8eFSv+iM81IPsDEsN0FSf1MUQPUUyrn+0ime6Qu1E0zjw01X?= =?us-ascii?Q?XEWHsdXYQovitOFumsg=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: 2aab1e93-6247-46c4-726a-08dcfe4b0762 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2024 10:08:57.9184 (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: AfLfO/HwpJHMd94lJBMrNXJ0AYm3zZ7K0q0+AERRBujBlz11hZmwKT9kdd/BV5ag+lER8r8l0UgFtDEukaN3vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR18MB3696 X-Proofpoint-ORIG-GUID: FiGE-DoE70VFNg6Eev-kUCZtA_c6ZPdQ X-Proofpoint-GUID: FiGE-DoE70VFNg6Eev-kUCZtA_c6ZPdQ 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 > --- Please rebase. CI failed to apply patch. Please be proactive to fix CI issues if reported. > doc/guides/rel_notes/release_24_11.rst | 3 ++ > lib/cryptodev/rte_crypto_asym.h | 56 +++++++++++++++++++------- > 2 files changed, 45 insertions(+), 14 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_24_11.rst > b/doc/guides/rel_notes/release_24_11.rst > index 53a5ffebe5..ee9e2cea3c 100644 > --- a/doc/guides/rel_notes/release_24_11.rst > +++ b/doc/guides/rel_notes/release_24_11.rst > @@ -413,6 +413,9 @@ ABI Changes > added new structure ``rte_node_xstats`` to ``rte_node_register`` and > added ``xstat_off`` to ``rte_node``. >=20 > +* cryptodev: The ``rte_crypto_sm2_op_param`` struct member to hold > ciphertext > + is changed to union data type. This change is to support partial SM2 c= alculation. > + >=20 > Known Issues > ------------ > diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_a= sym.h > index aeb46e688e..f095cebcd0 100644 > --- a/lib/cryptodev/rte_crypto_asym.h > +++ b/lib/cryptodev/rte_crypto_asym.h > @@ -646,6 +646,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 > /** > @@ -673,20 +675,46 @@ 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). > + * > + * Must be used along with the > RTE_CRYPTO_SM2_PARTIAL flag. > + */ > + 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). > + * > + * Must be used along with the > RTE_CRYPTO_SM2_PARTIAL flag. > + */ > + }; > + }; >=20 > rte_crypto_uint id; > /**< The SM2 id used by signer and verifier. */ > -- > 2.34.1