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 514BFA0032; Mon, 13 Dec 2021 09:14:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB4ED40140; Mon, 13 Dec 2021 09:14:19 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id A9F5440042 for ; Mon, 13 Dec 2021 09:14:17 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BD1ZFxI027372; Mon, 13 Dec 2021 00:14:16 -0800 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3cwvmys2rj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Dec 2021 00:14:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kyolfujW/Dazx+KNU1CtfakWhjX7Jan9yOBiZ4ry6yzFpHi2ZZ+t2OCTF0+RiDWSqOuNU0/4linuVf7+jf1cpxJ3PvV5Y/8Y+E2duYwYrp0H+KUP0tx8kyryxIgbLu+mBIjHCxRoiGP3kA6IwaejL+J5WoMnWsAtUUIIn4HCESaobERRCP7d6UvA6waRHFQxV7yspe37IhTZRC2cXX5/hLL4aNt3hT9nMHGXaFr/jD9wnPIU1O2OUyyACX5O9yzGYT6TECva0P6TWgUk3F9CFBIfMMm1IKpEAeciUIKKq7SaH0zD6FmbSrdu6oFGNhcCNQ77ETCTNNuwmBui4B855A== 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=+CYmpKpQiyQieyXnJ7yczuCAvXti0onIPyndwrd/4zo=; b=Dr+ub3HhXmbXXDCP/K1dWYkSJZf3UqkMMrztVclI3vhXpvV1AiC4c40Oq6rvWexeJuEzi+Yx+7i+262b92RJFWooeIx5SX7eZsbUZ1sGlus1++UjDf0UiNl3ndnXpT6mSyw4hBww5/Lzu5TDqjk53YkNj48DOunXOlzm45U51XMy52AoMdwtBVlFLGKY8OcQwx+D2Xge1zzzBMcBAbWZHypVMm21IPhk8FCCDXUk9jCfw5KIJ0jAjHuCiau35REUTDpIfAV65/tlPXQiyIvGqf4cCTSJfeLBypim2i88nxL18UXGG6yP2yf+UGrggYyQTE0h7Va0jr71Ko+dhos+CQ== 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=+CYmpKpQiyQieyXnJ7yczuCAvXti0onIPyndwrd/4zo=; b=TWMhf6ZUrB9ISruiWNRyD+7dN+GBDxjmuOPk/rmsBT3yC2r7WnHjc8E1ejfFworFA/ec9mMSe+DKZTIEAm30qSEqrAFiwdAMUM/utpyiBVzsq/M4IuyqdyynC7j1xDQvVynJNFtCqdxeDoYBYNr1CkwpMMkBDPrjYpGHsnj4F1I= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4633.namprd18.prod.outlook.com (2603:10b6:303:e0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.11; Mon, 13 Dec 2021 08:14:12 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c074:d988:9c2f:896d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c074:d988:9c2f:896d%6]) with mapi id 15.20.4778.017; Mon, 13 Dec 2021 08:14:12 +0000 From: Akhil Goyal To: "Kusztal, ArkadiuszX" , Anoob Joseph , "Zhang, Roy Fan" CC: "dev@dpdk.org" , Ramkumar Balu Subject: RE: [RFC] cryptodev: asymmetric crypto random number source Thread-Topic: [RFC] cryptodev: asymmetric crypto random number source Thread-Index: AdfoKBI9kOALuhClQZW5YQVgMKdrtQH0USEQ Date: Mon, 13 Dec 2021 08:14:12 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2ba0d40c-5477-4cf8-e0e2-08d9be108c1b x-ms-traffictypediagnostic: CO1PR18MB4633:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FEwxbNm4sXKzHOdnIWE1FmhWaoQ1TLNbPWdbJcRBWdg6G+D+1k/Q7EMiEUs2D4eJwgdaLrvgIU6MebPf8PO9M60rv4jT+9TvIL4P+gem418Xw+uUkZ/yLjWtlbXqP5OoAj7cEJvs4bC1xwOZQ+QOGnVS56OPbPCnWLaDNXLKD0jwUY5SF50LvJh5vCeAe8EnBOVWHVei9XqraaG1M6Kz5L9LKGuq9Cv4YbHFGCub/mkrPIM75Gs0ATXCofwe0VbudcPzHnOhWacLMDf0UdSF/H8Bgsoz4Ry47kuLWXiemBb8Zg9AQXriKjGPCmZH2yQu9ejQjwchrdIdNinj6B8PwE2FidZ2Klma4EdXEbjcDyxli+VbfLLrXfEQiKmpN1+NbQgRsHWW4hljUWlh7ef0etJv0c6Pjf0GA9aex93JJAyRElSXHBaGTNWVcM6wcrl/NyFF7jZF5FBWMG0vxSMU9VncEIHZh/OaxNVAgf6u47MDKkfNR9uri7O+N8bMSvj6YDfzWN6+keqsTFr43vi9Gwis5PTzlMkptNn4cmB8QoqG+753ee3uuyx8o2dDo1wZY4STrEB/vT/wvFN36P8opWbMdgBpwEaeQVFQg5LCl4i2h/qaeehjqcfenBBBWGz7TqbLRxugEBz4zV28o4iXqfetqCetRKpiaBuNr/Qtjhk/+H7Tsp/a1bvKGJWkkJoiyWhyPhhS7/x7IRXjwxRB9A== 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:(4636009)(366004)(54906003)(52536014)(8936002)(110136005)(66446008)(508600001)(33656002)(76116006)(64756008)(66476007)(66556008)(7696005)(9686003)(316002)(122000001)(5660300002)(4743002)(66946007)(38100700002)(107886003)(2906002)(4326008)(38070700005)(8676002)(6506007)(71200400001)(26005)(83380400001)(86362001)(55236004)(55016003)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?pMBY8Cd6kq7svCtk1BnENHowDc4EBnOqFxVRvufrG08CzxjfHsYw+voabCdE?= =?us-ascii?Q?1WnEP2yQ4Hc2dfBZ6EE65HG82yvVkYtXKfkckW0XXE7lo6Ll7zSt8aIM+BjE?= =?us-ascii?Q?nlDnOmXCDC4YvZ18Tf2w62veLGZ0Wxc1uwLMUpOoCXnY8JxfPHYn4koksEV5?= =?us-ascii?Q?wqCw394n/xIq+XtY2dKZioO12m7jVmleWPzhY+EQw59gytvQ4YyXNAgMsSHJ?= =?us-ascii?Q?gfxji4gkPPZdZw+6ft1V0mkAtcWka4RHQj8WxJi2EgOgU3YWgVji2O0h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H9qPVVW0SXyQas02TjnycOKMnSKZm?= =?us-ascii?Q?rOSofwayugujGlkPR/+ygpBnHRH1bpWiGltoac/dhEVhSjSyiqhqDNWTti5D?= =?us-ascii?Q?jey/QOUxtWSlo29MWgIF+li/p52v12AYzvDmZVAirg0IXhQRNWcA3jX5Qypc?= =?us-ascii?Q?qPwhu+bv1vF05NhPTnzsl5aGEtoS+axgwOfn5E8vLuhovxhLWCLaMhzWBJyj?= =?us-ascii?Q?/C2GHULjdqllPuA93flB1ZCBKfoIvsm6qmtyaVsCnAAM+y6iotj1m7jWIvGd?= =?us-ascii?Q?FXZZ3aHjBUW2AGEXKVYMjePPTovFbRQ6eSVB6JzNOQiwdcRktBkQ+4QDU4WU?= =?us-ascii?Q?39VZ4Lw3XEzRpJFwOwZxmisbOxcfGVa0nROvr7z2fIreh+Ab4SGEQLZmd/kJ?= =?us-ascii?Q?iqjTNMTBVKMW9Mcd87fL1AAaQ9AvfDPOAwCEuGeU275lwwhs3BPaz1MMRo9a?= =?us-ascii?Q?sSROJpG9rZY991uN1848IXA=3D?= Content-Type: multipart/alternative; boundary="_000_CO6PR18MB4484EFAA0A3347AC32E30F82D8749CO6PR18MB4484namp_" 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: 2ba0d40c-5477-4cf8-e0e2-08d9be108c1b X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2021 08:14:12.7593 (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: XIv37YIyoWT+2xo2cFtCUBuNgBuxOJJmowqhKj3usfPl+CIXsL3e3ei4qdNAEXqYjIjVe6uki5cwbiHkcfBDOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4633 X-Proofpoint-GUID: yV_lAizRseWrd8DIgxoW0LwzzikN1Y2H X-Proofpoint-ORIG-GUID: yV_lAizRseWrd8DIgxoW0LwzzikN1Y2H 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 --_000_CO6PR18MB4484EFAA0A3347AC32E30F82D8749CO6PR18MB4484namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable ++Ram for openssl ECDSA op: rte_crypto_param k; /**< The ECDSA per-message secret number, which is an intege= r * in the interval (1, n-1) */ DSA op: No 'k'. This one I think have described some time ago: Only PMD that verifies ECDSA is OCTEON which apparently needs 'k' provided = by user. Only PMD that verifies DSA is OpenSSL PMD which will generate its own rando= m number internally. So in case PMD supports one of these options (or especially when supports b= oth) we need to give some information here. The most obvious option would be to change rte_crypto_param k -> rte_crypto= _param *k In case (k =3D=3D NULL) PMD should generate it itself if possible, otherwis= e it should push crypto_op to the response ring with appropriate error code= . 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) --_000_CO6PR18MB4484EFAA0A3347AC32E30F82D8749CO6PR18MB4484namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

++Ram for openssl

 

ECDSA op:       &nb= sp;

rte_crypto_param k;<= /o:p>

        &nbs= p;      /**< The ECDSA per-message secret numbe= r, which is an integer

        &nbs= p;      * in the interval (1, n-1)

        &nbs= p;      */

DSA op:

        &nbs= p;      No ‘k’.

 

This one I think have described some time ago:<= /o:p>

Only PMD that verifies ECDSA is OCTEON which apparen= tly needs ‘k’ provided by user.

Only PMD that verifies DSA is OpenSSL PMD which will= generate its own random number internally.

 

So in case PMD supports one of these options (or esp= ecially when supports both) we need to give some information here.

 

The most obvious option would be to change rte_crypt= o_param k -> rte_crypto_param *k

In case (k =3D=3D NULL) PMD should generate it itsel= f if possible, otherwise it should push crypto_op to the response ring with= appropriate error code.

 

Another options would be:

  • Extend rte_crypt= odev_config and rte_cryptodev_info with information about random number generator for specific device (= though it would be ABI breakage)
  • Provide some kind of callback to get random num= ber from user (which could be useful for other things like RSA padding as w= ell)

=  

 

=  

--_000_CO6PR18MB4484EFAA0A3347AC32E30F82D8749CO6PR18MB4484namp_--