From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F3B5A0093 for ; Tue, 19 May 2020 12:47:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2B87D1D15E; Tue, 19 May 2020 12:47:28 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id A75601D15E; Tue, 19 May 2020 12:47:26 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04JAkTcg006268; Tue, 19 May 2020 03:47:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=wNCA/xr2qgj0znpcgjUYQv3YsXeTMOB/kmqNK4q+Iz0=; b=ov+J53YMXkXJiaUFX5OdUdDHtY5ky7HHtyt2QTJ5LKnumgqtqq0Kc9rigUxTd3/zUzHF 73RtU6LnK5hUdGOY8WF+jAc7YF9VlElVbZeuGqawjiINnwoXdkhQMI5PKh6qIMf3JKtH +OEXAyREcA4oPNMnCQh9PmnoeboCxZsY30t3rnOmlU8609TinXr3TwPIYL25SsTEBTe5 dWUQbkOWd6MAapSk2a9OA9mpeQDJatavQbG4kCt38GSlmmZiQu647uD4jkddoEVYGh9/ /2VTYZX0SlDbU2Z+EiVUhSQNK35XqMGeepiLzYNjrfNbjvPn66szx4kc0Le7Ka59l+GX HQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 312dhqkgud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 19 May 2020 03:47:25 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 May 2020 03:47:23 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 19 May 2020 03:47:24 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HRMMr/2RcuIAr3w4m30JcwKOlkeA76bsG7q7wu0Ro00FVf+lzUaeZ7DE3QpctDzuclmtPaNFBX+8BxMJjZwe4tIhM+hoSRuNwUrkqf57Bv6ZYqXr7lCfC1Ks3SlYmpTF1QfGdkTFk1G9bRm8xCqjxSJoZIfOckXnkrYX8j7J/3Ly/oai8JAb2R/U61G6xvCPQRi0ZRTSyE5wk3253PYdCZnZGw2d+2vYLwExcVVy4Ve5WXBuozLFEiHOP9jYFJeHBXHwWGwx8QCMLthuolkjhn/wujYTKxI7z7Drq/E95R0ZXJEYiyKwygtyyEKk2SDKSB0mnviR9rtJt9aiwo7kiw== 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-SenderADCheck; bh=wNCA/xr2qgj0znpcgjUYQv3YsXeTMOB/kmqNK4q+Iz0=; b=OmDL9TAdjrbwWz423oEUHnnyCmRDS6p52Udm2M6K5HHe5gQRHDInLPIsGfLN8PmI3nHYSkhAn8IuLkPWPXqQjUOCjwJy7VeOqyfQfZHQ588GWMGwBjc8LJ/qOuNnDo4pciVwQGdxeJ3sMd0WD94IH/oYCj5iG47qm5dNd/kwl0e+Eu4oYMrUhg46psG1hBNQPzpz2oFVYywKQ7owynARWFgwEB9AkdPIGjZkfEuwGd2qPxmIPQ6mToJ7SIcUGftxWeWWFFPnhOY26lkmSud/A/5Zb7iiYDKKghM4CoIUU3peG/iA2PBmt3emZ0/1vmgl3mQROUoXtSB2e06cdm5RKA== 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=wNCA/xr2qgj0znpcgjUYQv3YsXeTMOB/kmqNK4q+Iz0=; b=Lamlxov3iLbgQdzzDxrfbBV8+Kc0UoQ3NoYNwZu5J4afa+9iOIEiDS3QXCFv6pCIZrlY1VcSKHcRUO943AHgxaeiec0N7t4RAUrmwjGG1DcIcB0gh2bxljPUEgvqVPAdVvBiEoN4AG3C3Yev+R1EXUOBlqMxj2jeXBOipAbuh3k= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (2603:10b6:208:3b::26) by MN2PR18MB3621.namprd18.prod.outlook.com (2603:10b6:208:262::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.26; Tue, 19 May 2020 10:47:22 +0000 Received: from MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::15a6:7cce:c7ce:b74f]) by MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::15a6:7cce:c7ce:b74f%7]) with mapi id 15.20.3000.033; Tue, 19 May 2020 10:47:22 +0000 From: Anoob Joseph To: "Trahe, Fiona" , "Dybkowski, AdamX" , "dev@dpdk.org" , "akhil.goyal@nxp.com" CC: "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum comment Thread-Index: AQHWLSI1fSMpWps6+02JAes/IuKaE6iu6G0ggAA9z4CAAAFYYIAACeiAgAAE+gCAAAJX8A== Date: Tue, 19 May 2020 10:47:22 +0000 Message-ID: References: <20200518142342.1987-1-adamx.dybkowski@intel.com> In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=marvell.com; x-originating-ip: [111.125.205.80] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bb8303af-bfb0-4810-f931-08d7fbe202c3 x-ms-traffictypediagnostic: MN2PR18MB3621: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 040866B734 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OBUj4jYMb80D6rn2b46LMMr8wEm3qyAagTxzcl3UPZ+9C8ZU5mp7vqashxUhfDIo59/H1iVRTbrG0mF2yJPWK5tzuLmjTdhO37h+DzAt7jpEbXe83rgSOgItxWlxlZJXVBaG3kkjOHJexU9/1yTWlt3fvlfrFzSWZqGwa5JtNMwnXd8sPfGw0zEoO8YuMhNyDeR9dLf+BioTNmRFETq15fGp/3EdjpkK3aLq0v1TXKYI21mAiA6yqVM2MPaDW4a8f8+vB+sMWrlwovV7DT1G6AOQheAUWQmponFJWwGo9Dthf0p3AYklU//iWPHHaUioKU+FKF2pafjnNDw9RXdiKhJu5+24XqpDyCmjS/jNv8ZytBwBdomxdGj6SBXJLiLcpy4AOSECzplqumy9Pt+H0r7AIuCHyoc9OH43oOJLIBm45awN8/OgN2VmW2W7TEsvRf/PZhUDCi1M2/ttWdJh9gVNjoC79RcN+bUMqomAJQ5qqdWzzbN+ChJmyYoUDhnxSO5rMStaUgwN72RH7ZWnPQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR18MB2877.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39860400002)(366004)(136003)(346002)(376002)(66556008)(478600001)(66446008)(64756008)(110136005)(55016002)(316002)(52536014)(4326008)(76116006)(66946007)(66476007)(8936002)(6506007)(9686003)(2906002)(186003)(71200400001)(53546011)(55236004)(7696005)(33656002)(26005)(86362001)(8676002)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: allAgIDz+mdcS5WHIBFIvgGwJeYZ/TPsE5Evct/YtpDNqO559HxQrFbxRZr+0PfTvh0VhnQ6ft7UhvbGtEiIQpWqvyO+dyOa5I5KupqIj1iBd4PJPlIH6e9KK6a3YB932NuUAorDEr3yfX9+B915/DVsiezxJUG5hDK0Kpz6fixXK8zBuP7p5SQxeBvTf4uQ9OivZV5Mzja8Im3D8Yf4L9EaeLCCe9V2hnvhisgiwN141YRvMlMxZYYM0+25IVAP8UVYiylL+3fPNreOW6rX3ejcREBxIJqpeT27a0AemotW9Mx5WR+Q22muTcuvF7nWcC36Izsj9axbQlmTaH/WHLEem4W3/XU/oXYHLnYZMFhzh316qa1Cep6ixi0u3pe+d/4T1aOFI8zog4LHowCGCbcpQiA4J8bXn58yT1F4+n0jzqFFLdn/G7NwWg8VdtaGHK/eDkqGNryHzG7RI0T3qFclUbOyzO7JUYrp4GRzV6pWDadYqWJgFsqWnjnfoj3e x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bb8303af-bfb0-4810-f931-08d7fbe202c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 May 2020 10:47:22.1504 (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: 5NkUOxU92HlD8CGU8O2eaWBA9Ln3o9oMQ5KYQqm8mHtKrjwwr6WXTZ1MRpkQwZwamuBec855YiCh5uXgtZI3Cw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3621 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-19_03:2020-05-19, 2020-05-19 signatures=0 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum comment X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi Fiona, Please see inline. Thanks, Anoob > -----Original Message----- > From: Trahe, Fiona > Sent: Tuesday, May 19, 2020 3:59 PM > To: Dybkowski, AdamX ; Anoob Joseph > ; dev@dpdk.org; akhil.goyal@nxp.com > Cc: stable@dpdk.org; Trahe, Fiona > Subject: [EXT] RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum > comment >=20 > External Email >=20 > ---------------------------------------------------------------------- > Hi Adam, Anoob, >=20 >=20 > > > > > > > > > > > -----Original Message----- > > > > > > From: dev On Behalf Of Adam Dybkowski > > > > > > Sent: Monday, May 18, 2020 7:54 PM > > > > > > To: dev@dpdk.org; fiona.trahe@intel.com; akhil.goyal@nxp.com > > > > > > Cc: Adam Dybkowski ; > > > > > > stable@dpdk.org > > > > > > Subject: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum > > > > > > comment > > > > > > > > > > > > This patch fixes improper SHA-1 digest size in the enum comment= . > > > > > > > > > > > > Fixes: 1bd407fac80b ("cryptodev: extract symmetric > > > > > > operations") > > > > > > Cc: stable@dpdk.org > > > > > > > > > > > > Signed-off-by: Adam Dybkowski > > > > > > --- > > > > > > lib/librte_cryptodev/rte_crypto_sym.h | 4 ++-- > > > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > > > > > diff --git a/lib/librte_cryptodev/rte_crypto_sym.h > > > > > > b/lib/librte_cryptodev/rte_crypto_sym.h > > > > > > index d9585ecd6..9cea4e5f0 100644 > > > > > > --- a/lib/librte_cryptodev/rte_crypto_sym.h > > > > > > +++ b/lib/librte_cryptodev/rte_crypto_sym.h > > > > > > @@ -269,9 +269,9 @@ enum rte_crypto_auth_algorithm { > > > > > > /**< HMAC using MD5 algorithm */ > > > > > > > > > > > > RTE_CRYPTO_AUTH_SHA1, > > > > > > - /**< 128 bit SHA algorithm. */ > > > > > > + /**< 160 bit SHA algorithm. */ > > > > > > RTE_CRYPTO_AUTH_SHA1_HMAC, > > > > > > - /**< HMAC using 128 bit SHA algorithm. */ > > > > > > + /**< HMAC using 160 bit SHA algorithm. */ > > > > > > > > > > [Anoob] This raises one interesting question. Is HMAC-SHA-1-96 > > > > > (https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__tools.iet= f > > > > > .org > > > > > _h > > > > > > > > > > > > tml_rfc2404&d=3DDwIFAg&c=3DnKjWec2b6R0mOyPaz7xtfQ&r=3DjPfB8rwwviRSxyL > > > Ws2 > > > > n6B- > > > > > > > WYLn1v9SyTMrT5EQqh2TU&m=3DpgqB2BfFosCF_7l1SdoodgXcipf7G1ofht68ZK > > > Mt > > > > oW0&s=3DhxzUN2QfRJGaR7NQ7VKGm5oQvOZez6Z70mqOyg7gKTY&e=3D ) > > > treated as a > > > > separate algorithm or is it a digest size variant of > > > > RTE_CRYPTO_AUTH_SHA1_HMAC? I assume the later. > > > > > > > > [Adam] DPDK doesn't have separate enums for such variations. > > > > According to RFC 2104, chapter "5. Truncated output", the > > > > calculation of > > > > HMAC-SHA-1-96 is done using ordinary HMAC-SHA-1, but the > > > > calculation result is then truncated to 96 bits, or any other > > > > digest size provided in auth > > > xform. > > > > > > [Anoob] So it is allowed to support digest sizes 12 & 20, right? Can > > > you update the above comment in that case? > > > > [Adam] This depends on a particular PMD and its capabilities so we > > cannot write here in this public header file. For example, have a look = in the > capabilities structure of QAT PMD: > > > > { /* SHA1 */ \ > > .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, > \ > > {.sym =3D { \ > > .xform_type =3D RTE_CRYPTO_SYM_XFORM_AUTH, > \ > > {.auth =3D { \ > > .algo =3D RTE_CRYPTO_AUTH_SHA1, > \ > > .block_size =3D 64, \ > > .key_size =3D { \ > > .min =3D 0, \ > > .max =3D 0, \ > > .increment =3D 0 \ > > }, \ > > .digest_size =3D { \ > > .min =3D 1, \ > > .max =3D 20, \ > > .increment =3D 1 \ > > }, \ > > .iv_size =3D { 0 } \ > > }, } \ > > }, } \ > > }, \ > > > > It shows QAT PMD is able to truncate the output digest to any size from= 1 to > 20 bytes (160 bits). > > > > This can be different in other PMDs, for example OpenSSL and CCP PMDs > > allow only 20-byte digests here while Marvell MVSAM allows 12-20 bytes. > > > > Adam > [Fiona] True. But as 96 bits is a standard variant described in the spec,= how > about adding >=20 > /**< HMAC using 160 bit SHA algorithm. > HMAC-SHA-1-96 can be generated by setting digest_size to 12 */ >=20 > This doesn't imply that all PMDs must support that - same as for any othe= r > feature, the capabilities can vary. [Anoob] Your suggestion sounds ok to me. One confusion though. For SHA224 etc, the RFC specifies fixed digest size (like 224 bits or 28 by= tes). So the comment in the spec/library is accurate, but QAT has digest si= ze of 1-28 bytes. Is that correct? The comment in the spec says, "224 bit S= HA algorithm" but if other digest sizes are supported, that comment becomes= invalid, right?