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 E94A945B61; Thu, 17 Oct 2024 20:54:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78C134029C; Thu, 17 Oct 2024 20:54:20 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by mails.dpdk.org (Postfix) with ESMTP id E09E94025F for ; Thu, 17 Oct 2024 20:54:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729191259; x=1760727259; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=HELKU83JsQEQRpO9bPj6GafeY2x8yPNiXZdjz+0JpXU=; b=X2n6nim0Y30GKAlK4fTJzijEwL1chtJCUqNZBDuLs/3mL7c0R600W54j D2vusU2NLhTAFgSWVuHCxlKk5S7mzZwj/Hb+qf2cBbY9Z8PBzeKtfBGvA aivDq4DJXFjO9O0eCYMI7WyFVYnDtucxe2XchPaj//ZIgYTbuRlqcEmpx H+NJiNCQGhdFIzur7Sg9sgqs3/qM9rZgT4xFzCzpVB0LFgqIpXzmCFqJx dbq+9l0cgwa4zuGkOB4th/4Dr+5fM/7fogEi9z9xWrct3pQ0dWoiQvxja +FLN9QfsXMeYFdUVRrjy+TdW2jewQHx5GQOJcu00Lgtbsf5cAzbqcBpDV g==; X-CSE-ConnectionGUID: 0Om6nbQvT+uxWLBkAXcdJA== X-CSE-MsgGUID: fh+s8RdaRGm8mzWCHW9/2A== X-IronPort-AV: E=McAfee;i="6700,10204,11228"; a="39332956" X-IronPort-AV: E=Sophos;i="6.11,211,1725346800"; d="scan'208";a="39332956" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2024 11:54:18 -0700 X-CSE-ConnectionGUID: ZfBNWrodRSCKVBSnAMceKw== X-CSE-MsgGUID: D43Y7p4qQriqAU7adX4suA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,211,1725346800"; d="scan'208";a="101948704" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 Oct 2024 11:54:18 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 17 Oct 2024 11:54:17 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 17 Oct 2024 11:54:17 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 17 Oct 2024 11:54:17 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.177) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 17 Oct 2024 11:54:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jLjCTlDZWP1nZhFYbEeAzHEYoyCbP7/J1+SvaW0QJT+60X+JE49tOg3TgM7yYK25V8Nl+GyOcPzVL/h1Rw5nfaV5o/I+uo61dUbNH75stFkYVaMuf697KpmtntwiMnYLtTheGRlj+AWaAcXwf9bQtvYz4GNfviR/kttePLkqHpRl6XU5eb/U+gzZkIGuH3Wdm+HbnZcxt/21m8MRiFAwUxJVdG82JahJTQzEZG/5lDlKb4OfDg2tNafh6o53i66VluvwPj3GOgjLVA9tU3vsekpSi+3FtyAJZogBrkfhANbcAd+eOsojjl8fPPrvukh3LdAN6oVAuvponvgsk4j6YA== 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=5mtzclT8LnyciSTzW7nF8TPGt5JkdKx1FHZWH2MGlXI=; b=IYWwGigRaNojh1WFGQAJYXh/XUfeCW1DvrNf3O9b6RUqI3NM1Yepj4r/nwB45o0OH54zW2cvcDFxKLevnPRfArIMJ7+dZASEl7kO8D4E3fFjxRlqQZQ/9t/C0E2eVOlFMYjPEmQ7+hzZBEtd03tYTMHHObEm7ZjgYO6tjl/7WRvMKCAPetxPRWzQrrTwrXG1kgTcx3efnjvutM6rCJQONNPHGpasYVkZLk8a2d+hqS0sPRB93Z0rsEUxPYK2EuHmThA4LKMXtpmuGRhwHaa2D9pYmTGXJXow6fW0V4pv4gYSHnpU+YLf7riBTRWwUbyqVHxg/rxOEaTrsC0O+DA7Gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH0PR11MB5013.namprd11.prod.outlook.com (2603:10b6:510:30::21) by DS7PR11MB5990.namprd11.prod.outlook.com (2603:10b6:8:71::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.19; Thu, 17 Oct 2024 18:54:14 +0000 Received: from PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::1c54:1589:8882:d22b]) by PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::1c54:1589:8882:d22b%3]) with mapi id 15.20.8069.020; Thu, 17 Oct 2024 18:54:14 +0000 From: "Kusztal, ArkadiuszX" To: Akhil Goyal , "dev@dpdk.org" CC: "Dooley, Brian" 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: AQHbGlXqPC/QEVTUKkWsRh2gNUHcerKBeoQAgAnbCSA= Date: Thu, 17 Oct 2024 18:54:14 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR11MB5013:EE_|DS7PR11MB5990:EE_ x-ms-office365-filtering-correlation-id: aa72969a-3fe4-4ee7-9d9f-08dceedd186a 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?BRUEabIoKGLMce4DMk+MWuksQvoYmy9idrm2WAn6GBRPSJaKlAVQb5HRV1EQ?= =?us-ascii?Q?A03H3803vioPIKFeB9e6CX9pdceSKRBUSfjh0MpRGoR2CPdF3kG9DE/9Jk3L?= =?us-ascii?Q?c+k+iUhDAgfPxe48WLHFnis7eqnXfmYYUuNmsSkD3zMl1yyWxd/q9aqjjdss?= =?us-ascii?Q?i0SOrroM2NCfSt3yczeAJqS1hu7Ds2ZP0EpJMvGUAEruIqdOAr3j+zutYaVl?= =?us-ascii?Q?mHEJ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MLnqal+7I4gwwSehO?= =?us-ascii?Q?otRZV1dyQ/aOKusHCvkuYqPuOK/Rmp8Z01lkwDu6nCLlUjIyCns6fjSDvGSz?= =?us-ascii?Q?dqHNLsBVE4721HnoT7z5lcyKIxRHxR++kE4xPzCF9VPQnhfgVO79zmnXvkWK?= =?us-ascii?Q?S8neIxlOeyIPJ0QJzadbqc8AZXQW6GxzCwdTUsZ2+//n6T+Vm/HE1B4EXFq+?= =?us-ascii?Q?RIG0/ikcfW6WgvClmRugGbyX+0U8QtCBvok07hqv8P6hwFVhrWHLZRM8et8k?= =?us-ascii?Q?UUQj/LM=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5013.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?pL18cf8z7nkHwQ/tqs4JO6z42wwJH9BMpPPtJ/mnD7m4KSOQrGSPXttvU5Vf?= =?us-ascii?Q?IHTNEjbLGrEM26twqdmnx25DIndtzxSUMC4BnSwRuk2gW1WSYaLjfFtWWfjG?= =?us-ascii?Q?5J6J2030mIUu66osTVo0PoqoBC7pC+3Upa13ASbo9R1aS3O5t93onYfRaIXF?= =?us-ascii?Q?zgBQVjnMYVSKg2q95LF4CPZNE8g1+DrnVRtrLr9W3rrZDciof2NRuoICOdEx?= =?us-ascii?Q?a+1e1e26BvMAnfdYncNgkoEt9bqEo8F+S63gGwhQa8hcaF2kxXOCI4bxk8hX?= =?us-ascii?Q?fX6vdBs84MhIAs5hKzyoOwydRdKwGG1qauNFyHGh4il+JM6VgCo7PnaEDe3K?= =?us-ascii?Q?36yayUy+xsiUddMGZT5L8KIdTvz6B54i+r2+9gt2voKyhsVzo7DHE+N73M9b?= =?us-ascii?Q?w2fXJkOh3KxXI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d?= =?us-ascii?Q?gEuIJ/YVAuAn+Z68IgyhKZBqadt+m6Dq8CrQvE4D9YwXVTvqoIjkIxvGM1g+?= =?us-ascii?Q?y/ohoUzfXBbeZ8tf0NyAsjHFizHxueJ8HrtW+va/wpYWLtg5x7IK5mKGQ7Ej?= =?us-ascii?Q?/UYDSzlh5AM+TdZtm3qPudv8g0bRFcVTGQNNiJeBpvFX1YS7MSTGOCB2DAfk?= =?us-ascii?Q?MmXPnE9q3BTYmABU84hi+USgxP9jyYt2wh5EemFGw+Ed2VYdWNwsuDSiVNBv?= =?us-ascii?Q?SExRDKTFhIZbc78gW46eSrylCz2iZ94Of4bLWC29g6701ecBSUoaOBnxwGgq?= =?us-ascii?Q?ig=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5013.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa72969a-3fe4-4ee7-9d9f-08dceedd186a X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2024 18:54:14.4361 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TWIujjbuhXUyripTILxZrlElOlxjnej31w+hLrhZBL++zwA38/qax90GNm41n60Ro5hU13uQuNh2fpPa7vWgburG9WQwORUav1Lnw8YwV6Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB5990 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Akhil Goyal > Sent: Friday, October 11, 2024 2:18 PM > To: Kusztal, ArkadiuszX ; dev@dpdk.org > Cc: Dooley, Brian > Subject: RE: [EXTERNAL] [PATCH v5 2/4] cryptodev: add ec points to sm2 op >=20 > > 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. > > > > Points C1, kP therefore were added to the SM2 crypto operation struct. > > > > Signed-off-by: Arkadiusz Kusztal > > --- > > lib/cryptodev/rte_crypto_asym.h | 53 > > ++++++++++++++++++++++++++++++------ > > ----- > > 1 file changed, 39 insertions(+), 14 deletions(-) > > > > diff --git a/lib/cryptodev/rte_crypto_asym.h > > b/lib/cryptodev/rte_crypto_asym.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. */ > > }; > > > > /** > > @@ -634,20 +636,43 @@ struct rte_crypto_sm2_op_param { > > * will be overwritten by the PMD with the decrypted length. > > */ > > > > - 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 > It is better to keep the variable names in lower case. > c1 and kp should be fine. The reason for keeping some of the letters in uppercase is that it correspo= nds to the general convention of naming for these types. That's why we have dQ, qInv in RSA key for example, not dq, qinv. >=20 > > + }; > > + }; > > > > rte_crypto_uint id; > > /**< The SM2 id used by signer and verifier. */ > > -- > > 2.13.6