[dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum comment

Anoob Joseph anoobj at marvell.com
Tue May 19 11:40:29 CEST 2020


Hi Adam,

Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Dybkowski, AdamX <adamx.dybkowski at intel.com>
> Sent: Tuesday, May 19, 2020 3:01 PM
> To: Anoob Joseph <anoobj at marvell.com>; dev at dpdk.org; Trahe, Fiona
> <fiona.trahe at intel.com>; akhil.goyal at nxp.com
> Cc: stable at dpdk.org
> Subject: [EXT] RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum
> comment
> 
> External Email
> 
> ----------------------------------------------------------------------
> Hi.
> My answer below.
> 
> Adam
> 
> > -----Original Message-----
> > From: Anoob Joseph <anoobj at marvell.com>
> > Sent: Tuesday, 19 May, 2020 07:54
> > To: Dybkowski, AdamX <adamx.dybkowski at intel.com>; dev at dpdk.org; Trahe,
> > Fiona <fiona.trahe at intel.com>; akhil.goyal at nxp.com
> > Cc: stable at dpdk.org
> > Subject: RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum
> > comment
> >
> > Hi Adam, Akhil,
> >
> > Please see inline.
> >
> > Thanks,
> > Anoob
> >
> > > -----Original Message-----
> > > From: dev <dev-bounces at dpdk.org> On Behalf Of Adam Dybkowski
> > > Sent: Monday, May 18, 2020 7:54 PM
> > > To: dev at dpdk.org; fiona.trahe at intel.com; akhil.goyal at nxp.com
> > > Cc: Adam Dybkowski <adamx.dybkowski at intel.com>; stable at 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 at dpdk.org
> > >
> > > Signed-off-by: Adam Dybkowski <adamx.dybkowski at intel.com>
> > > ---
> > >  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=https-3A__tools.ietf.org_h
> >
> tml_rfc2404&d=DwIFAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=jPfB8rwwviRSxyLWs2
> n6B-
> WYLn1v9SyTMrT5EQqh2TU&m=pgqB2BfFosCF_7l1SdoodgXcipf7G1ofht68ZKMt
> oW0&s=hxzUN2QfRJGaR7NQ7VKGm5oQvOZez6Z70mqOyg7gKTY&e= ) 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? 

> 
> >
> > >  	RTE_CRYPTO_AUTH_SHA224,
> > >  	/**< 224 bit SHA algorithm. */
> > >  	RTE_CRYPTO_AUTH_SHA224_HMAC,
> > > --
> > > 2.17.1



More information about the dev mailing list