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 B703745B12; Fri, 11 Oct 2024 14:17:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A77CA4028B; Fri, 11 Oct 2024 14:17:59 +0200 (CEST) Received: from mx0a-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id EF5C34025F for ; Fri, 11 Oct 2024 14:17:57 +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 49BBcrhS031285; Fri, 11 Oct 2024 05:17:57 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2044.outbound.protection.outlook.com [104.47.58.44]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 426y390fpe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Oct 2024 05:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VI1TdorEM+irRIcbywxt9p5/m8RV5Kroq8VN+BIkFJp+B2U2I3KvKyuiwCbBerDb8RMRK9bO5ffd+aBtNpFyvL0J5qSxHRULat2GQW7ULBk3RBiEjuAUJBt55Nd1+R6muDZXQ8vVt6XBL13n8MGZvZDdc/Q8YHmTIkIyouwZupUlNFxuBT6KwWCDBy0Doe/pjCMYKZ50Zwd7+1DCV/mkNocLvoviNTK/7c3cBh4i7RIdLgrdB8zKbysL2Ai7mqiL/9FT0X7KfKHTSRLj0FGqBAP+dcaPZxGg1mTrSYCsFjL6Wz58dQmY7Isn93Nym/67vy6F0QFjVXHVQZ7v/TSogw== 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=rTs3dvU9nfxV+DrMaPNi2L7fkEAQUzoHJKVApEeJLSE=; b=lnZYTXLE+X+KZBX6R/yVV7AtvbhnGdgvFn/KBcu5myrqg/8Uj8d9CB6sj+T0aNSkSm3E8Klg81ILaes5Qv/tm8si+cjm7gSj1Q2cEpajcPvu9E8R0MBNC6ZAj+F7vwG3QYjaQm7LyZjhH/MIwwlgRKyTmgJqm88uOc7jHEI7BuCEG5kixQFoapnrlJcJjsm3tiJLY0Bje4kpXr6aied9xKxCXGmNqDrGRJlQxz42NtfBFKwn6kLtB1Fo3a9rlox/dHrN7nQs02xxOge/xDWQghVfI+oyWdes0ZqwVGp9RcKYNU2RI2Xmr5ysMPDqJCvRVDawRHQePqpjoNUkPOjb7w== 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=rTs3dvU9nfxV+DrMaPNi2L7fkEAQUzoHJKVApEeJLSE=; b=ieZ20mR1E851V29MVYjUwLcy+TEVxVojWS2mAqc2FRv7d+DJbm2zrrmhUtLXfzLNt9aNd/RqtteCuvW8CoDWV4zrgF4KWzCwGuZOzpZqRefXKpeX5ZNu8xZbtrmwPq+ROTj3PAZau+EZPuxPkIc73DBo1Ja6gYa3ZGjykGzIpeY= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by DM8PR18MB4502.namprd18.prod.outlook.com (2603:10b6:8:3b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Fri, 11 Oct 2024 12:17:52 +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.018; Fri, 11 Oct 2024 12:17:52 +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+/yktA7j0SKbKE3FMl6ALKBekqQ Date: Fri, 11 Oct 2024 12:17:52 +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_|DM8PR18MB4502:EE_ x-ms-office365-filtering-correlation-id: 7b725132-89c4-4dc4-9740-08dce9eebabf 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?Cjh7/hDrIv1S3MpEPpTstXtwZRqlv0hj6+TtFXZj7rqwphgLTyejURScccyV?= =?us-ascii?Q?t9M5nhs84OQIhadscwjSqlv1HP3ih7gmmqo0NWReEkYgWHIyBc5uM7/B/J19?= =?us-ascii?Q?mS+PT5jmX1zfd2KLFxQmXtJs/N5wJvVmLoXHeaCrk+21KKXriMnkXlduA3IB?= =?us-ascii?Q?BZwIWQr/ABPUYlketXGqn2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c2TsrMYapCJy/DT2PicVwtZom0cfqxR7kQnnv052QfZza3g76fhEE0UyK/o?= =?us-ascii?Q?yKl/FQzenjqOhIbWsbWXKZvsDneeiHBrqWm2Z1MsQBh3x8qIxBEUNSWNvF6e?= =?us-ascii?Q?NKb4tOmaQeyr0tLwBWQxue29wzqGamYeqKLG0DOpzrVFV6AdcnJDmK0qtfIV?= =?us-ascii?Q?gXRWqx8/fJO3Uqba19O/9mnmsQ570R4IAoGE+1POHtpgjHAd9Xum3z05YgHi?= =?us-ascii?Q?Sjn8FeYFLMEx6AksOynFzutf/8dEGOT5gAFO4mCMW/SX/A=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?IFt+qXeqvDnLOhI8LyXVvGRLfjZhT2I3zj99Irso6q+5PSM/HyF5jHCmDGOu?= =?us-ascii?Q?UizkqnRA6mE1m6owIV6RULnYLmmEqB0sNN462WwvYlNa5iD26ziriTJdIiKj?= =?us-ascii?Q?WjNLZ2QBQqcj7wMmVRjzHaebFfKqxI3vOSYa41i27cK/ShQSiTYnJrIjYBY7?= =?us-ascii?Q?eLoCINMsG0EiUtl3q2MwuGuQPJodKhVkS/Xn1qNJDQXkF/H7ZQsKSfL8cBDl?= =?us-ascii?Q?XXmJvrHqSqNDS7WbPWIdXMe/dAeicRgIXc/O5JngcFiqmtMsurO8mIKfVOax?= =?us-ascii?Q?e7jjv2PJ/6jk3z4RArxmrBKuoICdbfxWY1nEyRrx+X44Po5BhdFPA//YPpZW?= =?us-ascii?Q?1Or9WnFmePckJN9m1wdOTI8WNHkqmbGBI2jnR5qd9uxvAfV8b6cWVItL0Y0G?= =?us-ascii?Q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pKmt6bZRwAir?= =?us-ascii?Q?tqC6fN2xKZzYbxCGGk03EA1LQha4/xd3ym7yrVgT2Z0Z0LWK6GVOzjIkLqdl?= =?us-ascii?Q?ReV3luVWAxu59qCyZ8R21kLNmOVzbUQZN4P1GrWK9agYxwqj4BEXFL8PAj+8?= =?us-ascii?Q?b99YCScxwthaBTW3h6VQOkbYIsNTT0T7KSDf5c7FU5FzL6DdS3yyqJwh418V?= =?us-ascii?Q?TLcVGxMPB0eV+wd13tkwLvNZKnLq1AtfkUzZERRtC1y/eZ/cTnTDJZyG6yZw?= =?us-ascii?Q?5D3zKy2bOmBt9AQRmjgIygMcVTnkHM22oJ7xykmH?= 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: 7b725132-89c4-4dc4-9740-08dce9eebabf X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2024 12:17:52.3953 (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: vALptxZDgUNZZqMgl4SOAAvV1lHjv+mDnfmy4lOtilXSX40Y5+YW+4vpteBgOw/QeJqwA+4LRofmEwEDj/1dMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR18MB4502 X-Proofpoint-GUID: zYBEGB_N7mPQYYs1LPXwXdiWg-GwgkZh X-Proofpoint-ORIG-GUID: zYBEGB_N7mPQYYs1LPXwXdiWg-GwgkZh 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 | 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) > + */ It is better to keep the variable names in lower case. c1 and kp should be fine. > + }; > + }; >=20 > rte_crypto_uint id; > /**< The SM2 id used by signer and verifier. */ > -- > 2.13.6