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 4C0D1A0093; Tue, 19 May 2020 12:29:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E1A071D15D; Tue, 19 May 2020 12:29:28 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id A1CF81C21E; Tue, 19 May 2020 12:29:27 +0200 (CEST) IronPort-SDR: vrM8x/wsUa07IMS4Vqwq6ie1DIMj4HDlv4V88qdB5LUqGxps6qcpK27FdrI/Pjhl1bYsz6GRoJ jLqZAFhEjJiQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 03:29:26 -0700 IronPort-SDR: Anvv2JGzLtWEQEME8rusbo1Yjl7ePgjIW04IOtxrx/acQYE2VzhEUXKQssDzhottFbi7sDPUiM 8AXKqIMwc8lA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,409,1583222400"; d="scan'208";a="308364606" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 19 May 2020 03:29:26 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 19 May 2020 03:29:26 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 19 May 2020 03:29:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SaQyKOVRMnZWTvO5sDFWeOvIEwaGnXIHai613VEbpVPO0GojJw/kUXCBzXZuaNQEA2ixvj/wI1rf0aksNrrr71rqZostXDw2H6ZJS7V45NvNniD0oum1F57vA9tqngzehI13blYeyxtaITQTMpZLHa4cmGv2EOFersAJ0EmVkDxaezANRPlkmzAk8jWl2j4UeLtF1UIZtcbsmCezTycu1SjpZgX6thHnzr9bCCIZe/AZltSXUU9PyG2AIewHSoNHkgXyr96HA437buAYuhbL9frSJTDLW0TmEpFxccuW6/t2EO9Tr7jsuYi2IABu05uId/t5TObHPGJcr5G7kWugrg== 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=HRgckw9AXqejRwnutQNTCYz4FgNZtzh65PRIGaTBk0g=; b=mBXNjEHW9122F7w/cU63gHEM5o26YEg0GTn/iglQ+tOizi5GcZfE/JpksXf4VMPcZ5fPXO4EHKN4xEb+9p4Ys33QMoptD5ubtzFHpuY7s/M45qAM3fUES9jwcVLaCkhbzaQtaBWDVJvOvslIgsrYDRzo0MUz3gIyHY5pv3vLlPWBRm1QL4xXmZKZ51KCDL/+Ru8C3R84sXH3SAat6y/ZD2nLnTaArKvoDTFT8ZPEXIVyF9CXYPAqKBH7YQoF+u+YccAX20F+pvLp73zzb59sShbSLDUzkvBFKPurOuvs2qbU03v2WkpCcGMhzk54eIM4hzy69wz01y6hFHrar9Gy/A== 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=HRgckw9AXqejRwnutQNTCYz4FgNZtzh65PRIGaTBk0g=; b=ASQp5KBxlsRtJd18iBYmYz+CWYK38y6clw7a2AHi2/0iBUa20cH2wIp0o9zUT3eL1TZ+46Nr4dquR3Hno/PBJYdURJXHAwB4Q0hYuRiK/07LNjDXfeewYQziN9r7uXnRUpyxixdiv8DzNretLma5XLLQxJ4F+wFh67JT+1VIjlY= Received: from SN6PR11MB2880.namprd11.prod.outlook.com (2603:10b6:805:58::15) by SN6PR11MB2640.namprd11.prod.outlook.com (2603:10b6:805:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.27; Tue, 19 May 2020 10:29:24 +0000 Received: from SN6PR11MB2880.namprd11.prod.outlook.com ([fe80::c4ff:6258:78f7:ff90]) by SN6PR11MB2880.namprd11.prod.outlook.com ([fe80::c4ff:6258:78f7:ff90%5]) with mapi id 15.20.3021.020; Tue, 19 May 2020 10:29:24 +0000 From: "Trahe, Fiona" To: "Dybkowski, AdamX" , Anoob Joseph , "dev@dpdk.org" , "akhil.goyal@nxp.com" CC: "stable@dpdk.org" , "Trahe, Fiona" Thread-Topic: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum comment Thread-Index: AQHWLSJA1xN/mNWYGUKEC1NOtA1doKiu6YiAgAA8tICAAAKPgIAACLGAgAAByAA= Date: Tue, 19 May 2020 10:29:24 +0000 Message-ID: References: <20200518142342.1987-1-adamx.dybkowski@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.151.180] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f9e35459-c8ed-450a-5eb4-08d7fbdf8067 x-ms-traffictypediagnostic: SN6PR11MB2640: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 040866B734 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KW4J9XlCeEzDUCraLk21G1My6SC/uGT7VcWstPlWLoil7hQAOm6IIAA0auDuKKFhEjTKE6wS6eFfkTEHWG85vaYMPhXo2YAQlNjPhe/mKJeZT9iI6kKVbgu7WU0c0SQ4Sw/WYV897QbV7vl8DIC8+TodvGEiKbZJrnsqGEg3cWctAmpwRzaFZVXI1R3ovcfQdAAlWJj7teh7AwykOrjTAPvoq2sj+D1ibndioNF9Snp4SBSOaqnME4dh0m5qKhMsycBov06/opV46hFG3Ksjqd7HD8oylo8i70+knaN9uDbfuO0Zmwbd05sAoxMK501wlyUdh/MPP+wEItSvXX7FUaZHrDncwIz5lfSJbFsUKWwh7qk+1l0mWO+iGcCG7v5mPGEHXToBIijp7XBA5XwTS82b+53+H3ubW6xccmUC1FTD1UBGAhijoyRY9OfUBTzJBRYsICOnaJ/mptbK3K7IBaAwhWvzHLOKkxLwjruBudFMAWnGBZHujxL0q0hFXoR439AGHICprSRS6ULEfwRiFw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2880.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(136003)(366004)(346002)(39860400002)(376002)(396003)(55016002)(9686003)(478600001)(33656002)(7696005)(53546011)(6506007)(186003)(316002)(4326008)(5660300002)(26005)(8676002)(52536014)(86362001)(66476007)(66556008)(8936002)(76116006)(66946007)(64756008)(71200400001)(54906003)(66446008)(107886003)(110136005)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: z3w9HUSG2utECCTGxftscgxfMUr6JdjLYh0hbfZsu0dyd2wQiJQWVj9ERwJUIo+ELxIEaF3i6/ac7mmM4Lb2S9OKsQ2KvdEAmRdMNS6rDVl0ekQsFD+O8CvRvDOoe1RSF/aiGCLrp8LoTT1+owS8ksPsPINr1RXBXJojMh0OD7KYUZkb3NZ21xKwLNQ2uNyx6Uf6stKZ+GY7bdDZDpuVBioTUAq7WsMG52sjYtt1LyP7U4HRcCiU9iA5F8LbaWXYPhKB57/Uec6tAKFhs16dp9wXXzy/mpV5A1HPGdFkYneo7h1ZeFmhQF9eqvmVac2nh1zhEw2KJCSA/lJRo5uXHrvkwIw9H5JZX7MgoY6HKBTkimM7WqMe0ZCOCmz6ZxDL5n+YKf6rVKDc3TCwI+l4PfBLHiQ+v0L2NLqlOM+pGRh2FIaGPiE+5TwDKB3TDI4kopcyYnG1vmu6gyzIOwJDmXziGnwGqzWdU0hUabWsEKLBvWcG/IoGoEv72qDs/SWH Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f9e35459-c8ed-450a-5eb4-08d7fbdf8067 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 May 2020 10:29:24.5821 (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: niLBT2FaC4Fq//+vrYDniMCwXBPLJjwbM/kfsegmmmQp5hK7kE1Ve+kS0kVlP0TUJATviOr4203telBV2oMVgw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2640 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum comment X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Adam, Anoob, > > > > > > > > > -----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.ietf.= 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. Accordin= g > > > 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 provide= d in auth > > xform. > > > > [Anoob] So it is allowed to support digest sizes 12 & 20, right? Can yo= u > > update the above comment in that case? >=20 > [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 QA= T PMD: >=20 > { /* 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 } \ > }, } \ > }, } \ > }, \ >=20 > It shows QAT PMD is able to truncate the output digest to any size from 1= to 20 bytes (160 bits). >=20 > This can be different in other PMDs, for example OpenSSL and CCP PMDs all= ow only 20-byte digests > here while Marvell MVSAM allows 12-20 bytes. >=20 > Adam [Fiona] True. But as 96 bits is a standard variant described in the spec, h= ow about adding /**< HMAC using 160 bit SHA algorithm.=20 HMAC-SHA-1-96 can be generated by setting digest_size to 12 */ This doesn't imply that all PMDs must support that - same as for any other = feature, the capabilities can vary.