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 70763A04FF; Tue, 24 May 2022 17:14:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B0B142B8C; Tue, 24 May 2022 17:14:37 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id C780840140 for ; Tue, 24 May 2022 17:14:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653405276; x=1684941276; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=k4x+p5iCka1zLOyvBgCtND9of//cKt4dqKLya84fEZA=; b=A7xk6R0IE9bJlYpct9rUfR0sNGFE24PFdvzJK6/k+lFQj0RSrxdx4X01 DRnJJIVB8GJ1AvZFC2mLc3UGHJ/JS9i+Wys/EPMk9fbPyKpVaCesrHDEB qx7htzF9+QOs0CTrlGYPV+IaRs+9iCGQ3ucOKWFf+lS81XNH5uqNsoJbd 5+FEnn1JSstJulVwIr2lnalUeMJ+EZdgRcT8n/0Shja7IHuzvFM859hlx gS67a9HoHLkRpdWoKaEBbPZefjWo8xx64TyF+TW0xqlDAL1IMMhwtLt0M 78Mob1Qxw/kR0yGDHbxkQqaRvS0F3O/UCq0sC1nySABxzImXG7FxG1jbm Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="273553696" X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="273553696" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 08:14:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="601348650" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga008.jf.intel.com with ESMTP; 24 May 2022 08:14:34 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 24 May 2022 08:14:34 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 24 May 2022 08:14:33 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 24 May 2022 08:14:33 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.45) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 24 May 2022 08:14:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=av1Ndp81QLaed3sPgO5sPwDySph0sY7vFa59dKmyikPqNgOKy6ELkq5duVDFIaCumejZDJkXCvFvgyt2oQlWTxyYtw4/NX/uE+k6v7sPe7KZe5+MDaySDtME+Vq4dez4Ak1WYcXnuRFholwjsCGqfmvktMdkXPVi/Y0uq4Ej05LOO+3hC8CXg4ULVQRAXOtTR+FdzvL8U7I7byQKmbuPLEauFgdwuF+QPEaeAQj/iua7K0fDsoscCYj8NhewE5E6dQGOp6rIH6BUpr7CBR7zAOjIlYdxQ1msvCQeVmmmDYLBGsE5mWMZkuVRHZeYHRLlgjnAwpeXY/M+Q3o7ZljG9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=eDDiOsbD7890Ln/YnkHaLlXZdDpIwiV9KAIoxt+a79o=; b=J59g/db+5CrXnEjGt+VBThW3FsiJTWOW137OrdDKSgbnOncESvQEhU/AVUHK+pZNmCuKlIz4R02jVQ+b3IVUG2yFU/9ZHAvlycIkJ7zVk8xcxVztJlh2s8xKB5phR0lBv0kMK9Rh2MUaBq5v4kf7fWRxvBw0aDwO7lsBIX/NVBGLwihZnSph95E6BcxCciAXQUBdSy4vAMZdwobcUuAi0JuePOjQn7Q2O+IxmWalSbkDZj1HeyJsX2MMWH0/B2UudmXaMR1hvj2Dvl32LKDsBdEXdhdU9b1ne0EQxV0ghWgVP2o/qv/pB1oldHBf0Y3ddxkiXRM17tXnnX0/I4oaXQ== 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 CO1PR11MB5009.namprd11.prod.outlook.com (2603:10b6:303:9e::11) by DM5PR11MB2028.namprd11.prod.outlook.com (2603:10b6:3:d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Tue, 24 May 2022 15:14:31 +0000 Received: from CO1PR11MB5009.namprd11.prod.outlook.com ([fe80::f538:5980:ef0d:b634]) by CO1PR11MB5009.namprd11.prod.outlook.com ([fe80::f538:5980:ef0d:b634%6]) with mapi id 15.20.5273.023; Tue, 24 May 2022 15:14:31 +0000 From: "Kusztal, ArkadiuszX" To: Akhil Goyal , "dev@dpdk.org" CC: Anoob Joseph , "Zhang, Roy Fan" Subject: RE: [EXT] [PATCH 29/40] cryptodev: add salt length and optional label Thread-Topic: [EXT] [PATCH 29/40] cryptodev: add salt length and optional label Thread-Index: AQHYbBfCtpL2Imsu7U6oVUBwLD8txq0t+8gAgAAteMA= Date: Tue, 24 May 2022 15:14:31 +0000 Message-ID: References: <20220520055445.40063-1-arkadiuszx.kusztal@intel.com> <20220520055445.40063-30-arkadiuszx.kusztal@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.500.17 dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2ce87334-275d-4fb6-f16c-08da3d981aa0 x-ms-traffictypediagnostic: DM5PR11MB2028:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qMWERIMB3Oy770x1eGB32fCIvQtpne1k3zFNc3ibTRflpD6Oz3cVTdcYWgLnDVx0P1Mit8vwlVHoz/yyEB4d1JE/JCCtAIter0rqcCQP1eaqalRgE396phgbZ6kG0G7GFPS4h7yjG3Js8wuBmg78WXyYB0QVOr7YA7Y6q09UzjrR89iRb3XJd0UK8QjTtzZ/+I8pHhZPzZh75YjK5DkKMDYY4F+WG0FYv3iJI2LhL/vYMk9oJ6CebKopD4wircSCgUkwk/4DG3t6FeiKltrLKKoCVBSm+7JwF/HP5t7ylx9WGXReHE7JVELCZQKVBQuHH/e8QOKMhJ6proGXEMlW+obE3j/uNii751PWdEkrcEz9mfPqmocANNGh75wIwJ+DLQIVePwnSnioPoX1WeK5gA1KmWiHOTUHvJEcrgA94tYbpASCJNWRZemUOdVvNvwMpa28tFDhSE3Xth4DWSXpTcHHp6+9m3FzBjdNzYrdfdjDPMVTXNM5PQH6huuLcXotwpiMTE111VwqGJqtm/LjjWsYqEhXzD/ZjFT8rKQhwzqlEVgXkUonNX9F8UcAvx0T89NRRMrPUdOyIoY2yVBiM68TjiVSQaNMyBPjwcyajGgwDUmmsmK4GqiOQ0WDIZTY6vAroEkPvKP6KINZMv7pwyh7NONQUyaJ9pjRnYQg4bouTCi7LPSC/mHGkS69vSeNSA+oP75NnYbGAkBle4f3Hm2fcyk6HURVzNnEuJoGl4A= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB5009.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(66946007)(76116006)(8676002)(71200400001)(2906002)(66556008)(64756008)(38070700005)(6506007)(53546011)(66446008)(8936002)(38100700002)(33656002)(122000001)(55016003)(52536014)(82960400001)(5660300002)(66476007)(83380400001)(508600001)(7696005)(54906003)(316002)(107886003)(4326008)(110136005)(186003)(9686003)(26005)(86362001)(473944003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Z9QxB2fwY3WuT/qUQL+ZvvPFy5AGFLTpSGOZU+jl5FawRSpotjpNSDvClUQw?= =?us-ascii?Q?Xcqdvph93fdrlL0WiU689FrBwZlW5RoDy0RYDlY8I3SGI5kfn5smDSL6W5bG?= =?us-ascii?Q?y7yn389m7V2r24x8+ncVEXCTkSMXRWr6m5GlVJ7WBE4PM3msWqC5ka3kYguP?= =?us-ascii?Q?/99IHH2uszItaBPo01MCQyVEokWpTbyXfKEbwggIz5miqZ8MhmehsXsjBAqY?= =?us-ascii?Q?Kf/5Pfnieaq+xVikalxSUbVmqdlSF3EJ0IJJNPJ9BXujhii6dZWga729+1mD?= =?us-ascii?Q?YZoWZPSCsSMPXgGnbhgp60OgQX8oRlD2v9yYRmd07+4tPWNMpYFmG0JOpgJ4?= =?us-ascii?Q?LJI8y1oWHJz3bVbPBsJKZqgX3WQyfM8LNm87mix+g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rkZrRvM8j6PFPu35ne/2AQfVsNgLdWjYG7dM0sfRi9BFTMzNne?= =?us-ascii?Q?3dG/bxE7ZyP0B24VuRf3TVZYPoo64o91rEpU4AmGafI3MhiRERxziklFw+iz?= =?us-ascii?Q?JhGHDygAVywkiz5LZP69HzDc/mAbBSnZGCOIuswZcfMfJC0ItzrdJBJdR7jg?= =?us-ascii?Q?w8UEyXT5+BzuurntpLoR272SkaCp+hLwbuGkLbyDqB90JFsbNaNaXPhuhPQC?= =?us-ascii?Q?Xw1yCNWjPrP+V/Cb41dZTj6KsCZ3D259PE2KsPv85TE8GvzyPjgdZ3xS3R03?= =?us-ascii?Q?CWwOl1h4Z++0izDG89TpYtlevRt/iP8VsAKZdvSV4j2KoO8YsO1RuN6pMpnj?= =?us-ascii?Q?0QQXwGDKXH7/6qy9xmDfM9HkxqOM/54N4f3DnCublHXUsMvmbdL80PujCyRq?= =?us-ascii?Q?qe427azAtG4oigKpo5AoUWzxQ+GrJNt3CoA+J5R8vIMDSx1yTrxxuz8i5bM7?= =?us-ascii?Q?Uwgop7fUoDBuWAJoxME2EoQqU6J6+28=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: CO1PR11MB5009.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ce87334-275d-4fb6-f16c-08da3d981aa0 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 15:14:31.7268 (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: 9DRBm20mCef6SNLmgzJ7tSdUpXEeHKLm00Fd0+EWwB1+zX2KbHKtkLVmhif3zCh7GZ9d/sp8xyhaZq85VRYjXnQLRoG8KtJjod9td2vmPZM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB2028 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: Tuesday, May 24, 2022 2:30 PM > To: Kusztal, ArkadiuszX ; dev@dpdk.org > Cc: Anoob Joseph ; Zhang, Roy Fan > > Subject: RE: [EXT] [PATCH 29/40] cryptodev: add salt length and optional = label >=20 > > - added salt length and optional label. > > Common parameters to PSS and OAEP padding for RSA. >=20 > Please add description about how it is expected to be used. >=20 > > - Fixed hash API in RSA padding. > > Now it is specified how hash should be used with particular RSA > > padding modes. >=20 > I believe this should be a separate patch. Right? [Arek] +1 > Patch title does not justify this >=20 > > > > Signed-off-by: Arek Kusztal > > --- > > lib/cryptodev/rte_crypto_asym.h | 44 > > +++++++++++++++++++++++++++++++++++------ > > 1 file changed, 38 insertions(+), 6 deletions(-) > > > > diff --git a/lib/cryptodev/rte_crypto_asym.h > > b/lib/cryptodev/rte_crypto_asym.h index 97c3fbee38..c864b8a115 100644 > > --- a/lib/cryptodev/rte_crypto_asym.h > > +++ b/lib/cryptodev/rte_crypto_asym.h > > @@ -205,12 +205,29 @@ struct rte_crypto_rsa_priv_key_qt { > > */ > > struct rte_crypto_rsa_padding { > > enum rte_crypto_rsa_padding_type type; > > - /**< RSA padding scheme to be used for transform */ > > - enum rte_crypto_auth_algorithm md; >=20 > Any specific reason to change the field name? > I think this matches with the next field mgf1md [Arek] - now it aligns with RSA RFC. Both current names comes from the Open= SSL EVP_MD naming, in my rfc initially mgf1md was changed too into: +enum rte_crypto_mgf { + RTE_CRYPTO_MGF_DEFAULT, + /**< Default mask generation function */ + RTE_CRYPTO_MGF_MGF1_SHA1, + /**< MGF1 function with SHA1 hash algorithm */ But we do not need to be that conformant with the standard I think, so I ha= ve left it out. As for names it may be 'md' as well, every name is ok if is not excessively= long. >=20 > > - /**< Hash algorithm to be used for data hash if padding > > - * scheme is either OAEP or PSS. Valid hash algorithms > > - * are: > > - * MD5, SHA1, SHA224, SHA256, SHA384, SHA512 > > + /**< Type of RSA padding */ > > + enum rte_crypto_auth_algorithm hash; > > + /**< > > + * RSA padding hash function > > + * > > + * When a specific padding type is selected, the following rule apply= : > > + * - RTE_CRYPTO_RSA_PADDING_NONE: > > + * This field is ignored by the PMD > > + * > > + * - RTE_CRYPTO_RSA_PADDING_PKCS1_5: > > + * When signing operation this field is used to determine value > > + * of the DigestInfo structure, therefore specifying which algorithm > > + * was used to create the message digest. > > + * When doing encryption/decryption this field is ignored for this > > + * padding type. > > + * > > + * - RTE_CRYPTO_RSA_PADDING_OAEP > > + * This field shall be set with the hash algorithm used > > + * in the padding scheme > > + * > > + * - RTE_CRYPTO_RSA_PADDING_PSS > > + * This field shall be set with the hash algorithm used > > + * in the padding scheme (and to create the input message digest) > > */ > > enum rte_crypto_auth_algorithm mgf1md; > > /**< > > @@ -220,6 +237,21 @@ struct rte_crypto_rsa_padding { > > * for mask generation. Valid hash algorithms are: > > * MD5, SHA1, SHA224, SHA256, SHA384, SHA512 > > */ > > + uint16_t saltlen; > > + /**< > > + * RSA PSS padding salt length > > + * > > + * Used only when RTE_CRYPTO_RSA_PADDING_PSS padding is > > selected, >=20 > Used only when RTE_CRYPTO_RSA_PADDING_PSS is selected, >=20 > > + * otherwise ignored. > > + */ > > + rte_crypto_param label; > > + /**< > > + * RSA OAEP padding optional label > > + * > > + * Used only when RTE_CRYPTO_RSA_PADDING_OAEP padding is > > selected, >=20 > Drop the word padding. >=20 > BTW, can this be a union for label and saltlen? Yes, will do. > Also can we name them as pss_saltlen and oaep_label? Yes, though I am not entirely convinced. These names are unique anyway. >=20 > > + * otherwise ignored. If label.data =3D=3D NULL, a default > > + * label (empty string) is used. > > + */ > > }; > > > > /** > > -- > > 2.13.6