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 B328EA0548; Fri, 3 Dec 2021 11:03:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98D034014F; Fri, 3 Dec 2021 11:03:20 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 6020E40041 for ; Fri, 3 Dec 2021 11:03:18 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10186"; a="323203479" X-IronPort-AV: E=Sophos;i="5.87,284,1631602800"; d="scan'208,217";a="323203479" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2021 02:03:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,284,1631602800"; d="scan'208,217";a="460830695" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 03 Dec 2021 02:03:16 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 3 Dec 2021 02:03:16 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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.20; Fri, 3 Dec 2021 02:03:16 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Fri, 3 Dec 2021 02:03:16 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Fri, 3 Dec 2021 02:03:15 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=adduAd+sL6xA7vdrq4VMZGnU7tngzgzMt7YJ8RT8AdkO3vuRDUW9b1pR09AbMBOz81QCczegyQR9ITTLEyV6CKiMtqc+blAMLwX4eWOxjYVns4fxyZzRHKXjAOKTNBicY1e/bxHW4wJqLLOfe62BA5ZIhkNLt6okxB62wQ5tOdEZ+AfX6JEfBRWZihaUtRDWMoGVaRQsLiPAxgaOK5ptbjZ4F6UYXJ5bjD4WWCzFR+Gv1v6BD9cwUI0vH/uU1DghU78Sj9ab7CtcA3zrsgpErz3Sw6B/SLkHYx6iRYD41uzT9FjdmJ3mVKUwfkQjGL9iGXeS3Dc505xlx4NBDgMkKg== 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=JcWeFHTLTPY2Ll+xUuGKyehKtL5oWzP06wivu34eZp8=; b=mUB2v/rwzT92hSS/cpQ1PUjqXC23QbwHL21ZvUcWk5KXPwlkjGd6TFMSzSj/zSs4oR5wxJvtFOfhkAsJSg651LEB3XG5/Q6lRcK96NxmQhlbskX8J0Yrcgx60lhZjga8/HYwmi9VANygbzGRsZR4WAtmFaz2S6YRGqhEpJKpPhgU3lxZd3u6jtIGw5sTWdPxS/WP5IInqkLzmV/apkeLyla04xdfrtg8T17l3n1FfT8zZD5JW8ws7IFbKf/hnBOi2zv/Y5L/9kMLRC9BwO+F/yuuR2LL/tcSFin6IumBjpGEdP+u2QFd1bFdnqgwW/Fp7MdWyc96Q36nljX55X9W/Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JcWeFHTLTPY2Ll+xUuGKyehKtL5oWzP06wivu34eZp8=; b=JUtPbEqdeJcd2HEPjWRuEVwtYetPu3BDGgk0aUgo38mADLe0mdv5drK+9r0+4RI7qntQ3C9iRSUeubQFq78PNF1LO02fXW5HRpaUGInkyPde4CWqFODeDNkpbJv2z00EDSb/E090CgL7Nz23Hakipzz3ozLiopP0MOZqBJ85qhw= Received: from PH0PR11MB5013.namprd11.prod.outlook.com (2603:10b6:510:30::21) by PH7PR11MB5817.namprd11.prod.outlook.com (2603:10b6:510:13a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Fri, 3 Dec 2021 10:03:14 +0000 Received: from PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::119f:7b25:561b:1c72]) by PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::119f:7b25:561b:1c72%5]) with mapi id 15.20.4734.028; Fri, 3 Dec 2021 10:03:14 +0000 From: "Kusztal, ArkadiuszX" To: "gakhil@marvell.com" , Anoob Joseph , "Zhang, Roy Fan" CC: "dev@dpdk.org" Subject: [RFC] cryptodev: asymmetric crypto random number source Thread-Topic: [RFC] cryptodev: asymmetric crypto random number source Thread-Index: AdfoKBI9kOALuhClQZW5YQVgMKdrtQ== Date: Fri, 3 Dec 2021 10:03:14 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5e2ae2ee-809a-436a-f28e-08d9b6441f16 x-ms-traffictypediagnostic: PH7PR11MB5817: 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: 3IXLuSFiYgT9tYmL+SbkfDPY+pXvnW+/cGlqM4wJhAaT6dGq07aMj4xxQ/Kqqw+LqIiZPOuhss0thzvBd52YdC+Czi0h6HIigwVS8Vgs1C5Xkx9TfqxePaRKFHsFNjKdMY2a2jJeSpEX7knvyJjERtj1flzFobF7blgiV6YAPm+VTXnYjScGPO5DNoDLgEXY0Lj60yy55MFEwN8868JC8WJd+EjUwERx7jNkc0sqXoqvs6qFeha/9gIB3k0crN+/djeYYcRI3Z7Vb3vwVdiVc2iNyy4B1dLlPntBK3rSntI8YVcBvNagVYRTv/zrAtF2N14yfB1iK4HOxaJ38hyNyFVnnCgU7euVBldGjc1WGAjROb2Xd7kDcQwGe12MZ4Cufn2TFxlisJB0/H/taFMUaJ/3dwU0rm+4EHcMQUvf68bUxTZRPSD6w1CPlDAfEtIn5Fa51Cq+SaHi95IEolIg5SOnh0AP7Ba0RgLJcq3e/n6Gy9NrrRG/pTG5nLNekIZsZ7UA6y4AARYAJ+mpg/5H0EyKU2uZaFlKFSWfx8VBpNcu6z7V5GSQGCQQtVlDm2+WSRs482p8YrEu3G90BLabOkS0FjDitXITf69JLiIl8/Y9EEkjIDJhbLhxLKauAB5CoD7aLbdtVQEkbqSeF9Gl+HxO+Qe3eXafzPwP4IZOfOT/+lAAdubayaexo2nyayhGeCZx9sHo+fd+RWFMHrUiOg== 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:(366004)(4326008)(7696005)(6636002)(55016003)(122000001)(76116006)(4743002)(38070700005)(5660300002)(71200400001)(66946007)(38100700002)(52536014)(33656002)(86362001)(6506007)(316002)(64756008)(508600001)(66476007)(9686003)(66446008)(26005)(66556008)(8936002)(186003)(110136005)(82960400001)(8676002)(83380400001)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WqciyLjY4Tg/6e5h5OwAqzRsxpYLB7i01lUj7S7TBXKUXTu/BREWt+gIPrXO?= =?us-ascii?Q?hMi3XhjqajG2QczOgj/CY78Gw5CTwLphOyAWDHBPjguYtoO87dLJT0m0A8Et?= =?us-ascii?Q?8UfK2tAm80uqmPeWDQWBGEVvykb7FpvdJJs0YdLOU5Ck2amU34mT2hntcPj5?= =?us-ascii?Q?Ubrv/3zDhR7zDP1ola24uUbTv5E7/5lH9C9x0eaBdJvK+MYGxnFLkllYuUmz?= =?us-ascii?Q?f+dH4DSO5ed3KN/b3neo7hptCT0OCN1PD8sJ8vBTUDvndmhaxDODRjhhZMZs?= =?us-ascii?Q?QfJlz2Dw/edAKrkHyYSBUbD4zgT4thDf17UqdBgwr71cFg7V84waOB/FSIGI?= =?us-ascii?Q?KIhhw+xgeBLMVn5GqXdFQMyVEiVdmQ/pjKk3LZ5TZdEz86Gh0nbtVmOzbnTE?= =?us-ascii?Q?kdPhY6lPz42d7HH8IfBF8LywXpS4y8MNgC9WmDvlTSp1G6VCohVuq9BrKcrf?= =?us-ascii?Q?x6QUBjHX3AG8EwlN2uPjtJwJKF3tNByHwvE5GTEBTl7LdSxR5kHSzW+TozOS?= =?us-ascii?Q?qvVpaDpG4PXjtBn1T6nomZrL4Y8LWBzVXdesLVj5fwwLo4hnu2mIS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RviFYC7CIPG0Fy5tJm7CCmBg804wHGt/HmrvCMPb?= =?us-ascii?Q?kl5aDHD05MCnqfOrw7VDxfs5DFixvfXCNf0zrZdjOVCnJ5v04MFI3ozpuS10?= =?us-ascii?Q?CMTUJuyp59yCvUoNSjPLNIdab+sUYH7K/b3hFsjVB4H31TjZtI6P+G7ULVV7?= =?us-ascii?Q?47bNAnBOcZ6/sOPNFqf80KMZ+H//kbKEtqVOBpK97WGOHGa7LY1vsRNUXtbz?= =?us-ascii?Q?dckzAg=3D=3D?= Content-Type: multipart/alternative; boundary="_000_PH0PR11MB50131E8565E698E8D7E581379F6A9PH0PR11MB5013namp_" 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: 5e2ae2ee-809a-436a-f28e-08d9b6441f16 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2021 10:03:14.4468 (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: HTFELXgb22lOHK32qU014E9KG3zSTSUcBvQAjT3HTZv52Lk2d5QeS7OGUhqFqFsNaxofqMMsXmantPdzdoxSPEZkQ6UL/uM+EobcUV5p5R8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5817 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 --_000_PH0PR11MB50131E8565E698E8D7E581379F6A9PH0PR11MB5013namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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_PH0PR11MB50131E8565E698E8D7E581379F6A9PH0PR11MB5013namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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_PH0PR11MB50131E8565E698E8D7E581379F6A9PH0PR11MB5013namp_--