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 E32F5A0032; Mon, 13 Dec 2021 10:27:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CE60410F5; Mon, 13 Dec 2021 10:27:10 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 9448E40E09 for ; Mon, 13 Dec 2021 10:27:08 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BD7j4Fm027709; Mon, 13 Dec 2021 01:27:07 -0800 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3cx21kgaty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Dec 2021 01:27:07 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oaqbAVJmRtkxrsJskw1UeRXsTN3xi/uKzXQb0K5ScTwYCukXvabKQWcXL7PHhV/0lHHbtVNN/0bUHrXaEahshkSAafrSBjzPy2UMvNGRJ7SL0NPD8ZoVuhlKDzob5HmSKcQYXFqjYfwOK0bSvNjyYT0cjFq/aXJJpYXsgyAxS5aiZecJckYA6+jzo/cLhChJbG7DRCVVTAJEWjQGPbOLmKU9mgkR1okTusR3GU7oEmjGHcwEpj1bFvpTJH3EIldNrguacb+Hp9usi+ukBjQZKFvjlYQbfxVROWONaiYw5gxKhSYeh8y9Dt9aZqx+qy3syYPd6KwAygaMEnicmRqs1Q== 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=V1PK7VSWhCkydcdsDBYCTfb9VZ/hvvSkXqrJyvNjqaA=; b=XCw7sCuJlKCdB1v+BuC7S4k5XdYvh1sE+kXRCkmJX6sWG7nczG/YLMPSGYvJPhq3frl3iRmEp0WJw+iH7Z9Db7gpxf+lBpet8aX0IMFN+7CzLtZL+qxZh9Om+QUIk3PlqcqpxmiHEXTp9mBe9MZb66shLiyfWbLBrdmwPK5ryfkjDGntwLuLuZxdhad27viHQnCHEEN1QmV8gf1xgN6e1aQkoaY0DydhsLAeK4o/0UF3jnsFvd0wPpoL9jCxD8qWMcf08eSiynrZBW6UiYShy7SN117r0mviCmWaB6qxaKg1ja67KifXAP+poNKKkFTXYIEZOBFD0iW+9v6PSrkVfg== 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.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V1PK7VSWhCkydcdsDBYCTfb9VZ/hvvSkXqrJyvNjqaA=; b=JrLyQUg8FiUmY0AcVacfXXmM+gyA/8kQY/k7XaV0fKlKZuiYPXlndda4SXqpaOEzgmrfH2hrtM6raSqbofERuffO59HrbHonqj6D914mX0EtpI+astPCRBIh7ggTj26+X959FDt2qqifcTTbC0D37nZ9HTZNm+cIFtVeK1sjgMo= Received: from DM5PR1801MB2074.namprd18.prod.outlook.com (2603:10b6:4:63::21) by DM4PR18MB4221.namprd18.prod.outlook.com (2603:10b6:5:390::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Mon, 13 Dec 2021 09:27:05 +0000 Received: from DM5PR1801MB2074.namprd18.prod.outlook.com ([fe80::7d46:eac1:1a74:a2bf]) by DM5PR1801MB2074.namprd18.prod.outlook.com ([fe80::7d46:eac1:1a74:a2bf%7]) with mapi id 15.20.4778.014; Mon, 13 Dec 2021 09:27:05 +0000 From: Ramkumar Balu To: Akhil Goyal , "Kusztal, ArkadiuszX" , Anoob Joseph , "Zhang, Roy Fan" CC: "dev@dpdk.org" Subject: RE: [RFC] cryptodev: asymmetric crypto random number source Thread-Topic: [RFC] cryptodev: asymmetric crypto random number source Thread-Index: AdfoKBI9kOALuhClQZW5YQVgMKdrtQH0USEQAAHd3EA= Date: Mon, 13 Dec 2021 09:27:05 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0a0c6367-1ffc-4339-69f7-08d9be1aba31 x-ms-traffictypediagnostic: DM4PR18MB4221:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Z8n4/j2aJgyAQbwpeDXWAygyf9+gb0JkwMScDgoDhtf9Rcp2gvwT0fGPcjWMgj4wbxcRB/D8agw6JfiEcu7n149e2ae1H8vifC/pMDaSA/+aVz0ARXNusqEZpLxuWZnjU22M7HQb6ujp7CZ4d0wqqDDDp9D+779QmBM8gDc8PJjas4QcWSVmThLOl4uh/SHYBgkX6UUxE4Ha3iGeJ5CvadLcDZaXYD7igjY1Cf9Btr2EusnEl2/TQ+GIu7izdUwx5HHbc8WtGNQb7JzdE6anEdJNLkNMoFfx3MP8tuMocl0VpEPPReoS0LTReufrisTHhc07nbybP7WuyoMPSVAsfZ5Q+MwvuIZ0p76km0MeT+iNypxdMTMIXt5Y2YUpIHGwgMuQStPGzHYPBeCg821dMAtt22R5wL3AXkttnhxygKyLX/M8HV6Fxt28b0K4xyYNwXCXaHBhXPH4YfWjUruxlFpSjZPJcsOjpBjvSNfmRYCulF6jplW6s8J2dwcvk+UrzawksbQU77ln02CQKKjOkIwfxR+ooTSYsncJg9c1AymZ123NwwjJ4fpg8VBVZtuwTSe8LLXDt6XZLO6UJz2rbEanC4jSi24q5utMw7NBTDJ4lzwTyzh+gA2TpxdYS8izZmfGTtV4Ti4EAeEw1jYNM+r4LRV0xtmH0r7BdaKkCdomiCGIxPeZ2jNwQjamqBvChUr+w4W1ANYsOcoPNPCUpw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR1801MB2074.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(2906002)(122000001)(4743002)(66446008)(66476007)(7696005)(9686003)(38070700005)(38100700002)(186003)(55016003)(64756008)(110136005)(8676002)(5660300002)(76116006)(66946007)(71200400001)(4326008)(33656002)(6506007)(86362001)(66556008)(52536014)(8936002)(508600001)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?ngmN7PE6E7pcPUW57IqtGmhKx0cg9TqScS8wQuztL4LNS2WsrKTIlvyWLQ?= =?iso-8859-1?Q?2irwa27M46BpO9UKJacFDAZbX5Q0fsjmbmmawn+A/poLUBbYwzUSlmGb4H?= =?iso-8859-1?Q?y8zzLLUmUGdzBm57uPkI2LpdLyNrAXy/lKcLY1vUH1uaHXuAahk2nfA0/3?= =?iso-8859-1?Q?6mDvw6hiLxDIuuATy4dyUmd7uZTNdY5dPgS1+bJyOZ8RTa6KYlncIA3SO0?= =?iso-8859-1?Q?e/eFf5hXFrYphWqenRTa3VtQ+nQbEzaZ6StPR6p+XwTF+dPL4p89uaXS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A+u09AohSaY/QGVQznO/wZ4lw/Rw?= =?iso-8859-1?Q?wNJF+QIMFtj5YEo/Q7HR7+Ie6B0Yp3In7c9l/SNjrBzCrl/x1vspetuDLJ?= =?iso-8859-1?Q?MlQBT80KaBfhojGTH30tuIqFJPJmN6BGy3U1n+LScqV1mw+1wCh7EgqTDJ?= =?iso-8859-1?Q?wuKsD7lcXcun+oKWv+a7VyyC8BEnZcWuXLAAQ5CZmG+bplctNPafBpjDFG?= =?iso-8859-1?Q?+ZWT6x6rYcf34P/z38kSYIW7h33T6t6wlpaWA4erokyz6X2XIn8hwhRxE8?= =?iso-8859-1?Q?tLbZf6gI9fFM7ZbJYgPb2H/sHwVnCukljJxBkrrKEUZYAfui6aXUwSjSqg?= =?iso-8859-1?Q?wL4dc2P5+g8p6VTa4JnfNt+GwJz+SiIGJiChsPNAuwZxEuHYZGWIitVC4e?= =?iso-8859-1?Q?Ae/fFYWfh5b96Emf2yj15wu8AO6N1BFz9E6Mxo1y66dVSZJmYxP2guPANo?= =?iso-8859-1?Q?qoQD9V79ZDZqm2w1LGX1bYJXC/CVpZs5+i1LGf1Ye5z0m9qp6W6gvPtcfg?= =?iso-8859-1?Q?luWtZXjXeGSHaR1gvELjwVFgofAOnAURlLD0FZ9w4n53tiLG3WcdOzFLi8?= =?iso-8859-1?Q?IBRPRb7hEbrU4F7epSJtc5FZo=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR1801MB2074.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a0c6367-1ffc-4339-69f7-08d9be1aba31 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2021 09:27:05.0301 (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: LjolC9AX3GyM+406vyEabuauirBsZtvm6yGnDFDOpO1PE5ZlpgAbvLUITEAEruP77UhBOYexGpHZzNs+9lTP+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR18MB4221 X-Proofpoint-GUID: pJDdeghjVc7VKkjCPUCqZJU_LgLZko2v X-Proofpoint-ORIG-GUID: pJDdeghjVc7VKkjCPUCqZJU_LgLZko2v X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-13_03,2021-12-10_01,2021-12-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 > ++Ram for openssl >=20 > > ECDSA op:=A0=A0=A0=A0=A0=A0=A0=A0=20 > > rte_crypto_param k; > >=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /**< The ECDSA per-message se= cret number, which is an integer > >=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 * in the interval (1, n-1) > >=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 */ > > DSA op: > >=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 No 'k'. > > > > This one I think have described some time ago: > > Only PMD that verifies ECDSA is OCTEON which apparently needs 'k' provi= ded by user. > > Only PMD that verifies DSA is OpenSSL PMD which will generate its own r= andom number internally. > > > > So in case PMD supports one of these options (or especially when suppor= ts both) we need to give some information here. We can have a standard way to represent if a particular rte_crypto_param is= set by the application or not. Then, it is up to the PMD to perform the o= p or return error code if unable to proceed. > > > > The most obvious option would be to change rte_crypto_param k -> rte_cr= ypto_param *k > > In case (k =3D=3D NULL) PMD should generate it itself if possible, othe= rwise it should push crypto_op to the response ring with appropriate error = code. This case could occur for other params as well. Having a few as nested vari= ables and others as pointers could be confusing for memory alloc/dealloc. H= owever, the rte_crypto_param already has a data pointer inside it which can= be used in same manner. For example, in this case (k.data =3D=3D NULL), PM= D should generate random number if possible or push to response ring with e= rror code. This can be done without breaking backward compatibility. This can be the standard way for PMDs to find if a particular rte_crypto_pa= ram is valid or NULL. > > > > Another options would be: > > - Extend rte_cryptodev_config and rte_cryptodev_info with information a= bout random number generator for specific device (though it would be ABI br= eakage) > > - Provide some kind of callback to get random number from user (which c= ould be useful for other things like RSA padding as well) I think the previous solution itself is more straightforward and simpler un= less we want to have functionality to configure random number generator for= each device. Thanks, Ramkumar Balu