cryptodev: fix SHA-1 digest enum comment
PATCH 1/1 cryptodev: fix SHA-1 digest enum comment
This patch fixes improper SHA-1 digest size in the enum comment.
--- lib/librte_cryptodev/rte_crypto_sym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_cryptodev/rte_crypto_sym.h +2 -2
@@ -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. */ RTE_CRYPTO_AUTH_SHA224 ,/**< 224 bit SHA algorithm. */ RTE_CRYPTO_AUTH_SHA224_HMAC,
Signature · 1 line
2.17.1
Hi Adam, Akhil,
Please see inline.
Thanks,
Anoob
Quoted 23 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Adam Dybkowski
Sent: Monday, May 18, 2020 7:54 PM
To: [email protected]; [email protected]; [email protected]
Cc: Adam Dybkowski <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentThis patch fixes improper SHA-1 digest size in the enum comment.
Fixes 1bd407fac80b ("cryptodev: extract symmetric operations")Signed-off-by Adam Dybkowski <[email protected]>--- lib/librte_cryptodev/rte_crypto_sym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/librte_cryptodev/rte_crypto_sym.h +0
-0
lib/librte_cryptodev/rte_crypto_sym.h enum rte_crypto_auth_algorithm { · line 274
Quoted 8 lines
lib/librte_cryptodev/rte_crypto_sym.h +2
-2@@ -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://tools.ietf.org/html/rfc2404) treated as a separate algorithm or is it a digest size variant of RTE_CRYPTO_AUTH_SHA1_HMAC? I assume the later.
Quoted 5 lines
lib/librte_cryptodev/rte_crypto_sym.h +0
-1RTE_CRYPTO_AUTH_SHA224 ,/**< 224 bit SHA algorithm. */ RTE_CRYPTO_AUTH_SHA224_HMAC, --2.17.1
Hi.
My answer below.
Adam
Quoted 40 lines
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Tuesday, 19 May, 2020 07:54
To: Dybkowski, AdamX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentHi Adam, Akhil,
Please see inline.
Thanks,
AnoobQuoted 25 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Adam Dybkowski
Sent: Monday, May 18, 2020 7:54 PM
To: [email protected]; [email protected]; [email protected]
Cc: Adam Dybkowski <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentThis patch fixes improper SHA-1 digest size in the enum comment.
Fixes 1bd407fac80b ("cryptodev: extract symmetric operations")Signed-off-by Adam Dybkowski <[email protected]>--- lib/librte_cryptodev/rte_crypto_sym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/librte_cryptodev/rte_crypto_sym.h +0
-0@@ -269,9 +269,9 @@ enum rte_crypto_auth_algorithm {/**< HMAC using MD5 algorithm */
Quoted 10 lines
lib/librte_cryptodev/rte_crypto_sym.h enum rte_crypto_auth_algorithm { · line 274
Quoted 6 lines
lib/librte_cryptodev/rte_crypto_sym.h +2
-2RTE_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://tools.ietf.org/html/rfc2404) treated as a separate algorithm or is it a digest size variant ofRTE_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.
Quoted 6 lines
Quoted 6 lines
lib/librte_cryptodev/rte_crypto_sym.h +0
-1RTE_CRYPTO_AUTH_SHA224 ,/**< 224 bit SHA algorithm. */ RTE_CRYPTO_AUTH_SHA224_HMAC, --2.17.1
Hi Adam,
Please see inline.
Thanks,
Anoob
Quoted 75 lines
-----Original Message-----
From: Dybkowski, AdamX <[email protected]>
Sent: Tuesday, May 19, 2020 3:01 PM
To: Anoob Joseph <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: [email protected]
Subject: [EXT] RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentExternal Email
----------------------------------------------------------------------
Hi.
My answer below.Adam
Quoted 41 lines
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Tuesday, 19 May, 2020 07:54
To: Dybkowski, AdamX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentHi Adam, Akhil,
Please see inline.
Thanks,
AnoobQuoted 25 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Adam Dybkowski
Sent: Monday, May 18, 2020 7:54 PM
To: [email protected]; [email protected]; [email protected]
Cc: Adam Dybkowski <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentThis patch fixes improper SHA-1 digest size in the enum comment.
Fixes 1bd407fac80b ("cryptodev: extract symmetric operations")Signed-off-by Adam Dybkowski <[email protected]>--- lib/librte_cryptodev/rte_crypto_sym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/librte_cryptodev/rte_crypto_sym.h +0
-0@@ -269,9 +269,9 @@ enum rte_crypto_auth_algorithm {/**< HMAC using MD5 algorithm */ Quoted 10 lines
lib/librte_cryptodev/rte_crypto_sym.h enum rte_crypto_auth_algorithm { · line 274
Quoted 6 lines
lib/librte_cryptodev/rte_crypto_sym.h +2
-2RTE_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_html_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.
Quoted 4 lines
[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?
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
lib/librte_cryptodev/rte_crypto_sym.h +0
-1RTE_CRYPTO_AUTH_SHA224 ,/**< 224 bit SHA algorithm. */ RTE_CRYPTO_AUTH_SHA224_HMAC, --2.17.1
Quoted 97 lines
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Tuesday, 19 May, 2020 11:40
To: Dybkowski, AdamX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentHi Adam,
Please see inline.
Thanks,
AnoobQuoted 9 lines
-----Original Message-----
From: Dybkowski, AdamX <[email protected]>
Sent: Tuesday, May 19, 2020 3:01 PM
To: Anoob Joseph <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: [email protected]
Subject: [EXT] RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentQuoted 62 lines
External Email
----------------------------------------------------------------------
Hi.
My answer below.Adam
Quoted 53 lines
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Tuesday, 19 May, 2020 07:54
To: Dybkowski, AdamX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentHi Adam, Akhil,
Please see inline.
Thanks,
AnoobQuoted 24 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Adam Dybkowski
Sent: Monday, May 18, 2020 7:54 PM
To: [email protected]; [email protected]; [email protected]
Cc: Adam Dybkowski <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentThis patch fixes improper SHA-1 digest size in the enum comment.
Fixes 1bd407fac80b ("cryptodev: extract symmetric operations")Signed-off-by Adam Dybkowski <[email protected]>--- lib/librte_cryptodev/rte_crypto_sym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/librte_cryptodev/rte_crypto_sym.h +0
-0lib/librte_cryptodev/rte_crypto_sym.h enum rte_crypto_auth_algorithm { · line 274
Quoted 8 lines
lib/librte_cryptodev/rte_crypto_sym.h +2
-2@@ -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
_html_rfc2404&d=DwIFAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=jPfB8rwwviRSxyL Ws2
Quoted 2 lines
n6B-
WYLn1v9SyTMrT5EQqh2TU&m=pgqB2BfFosCF_7l1SdoodgXcipf7G1ofht68ZK Mt
Quoted 1 line
oW0&s=hxzUN2QfRJGaR7NQ7VKGm5oQvOZez6Z70mqOyg7gKTY&e= )
treated as a
Quoted 3 lines
separate algorithm or is it a digest size variant of
RTE_CRYPTO_AUTH_SHA1_HMAC? I assume the later.
Quoted 8 lines
Quoted 4 lines
[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 = RTE_CRYPTO_OP_TYPE_SYMMETRIC, \
{.sym = { \
.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, \
{.auth = { \
.algo = RTE_CRYPTO_AUTH_SHA1, \
.block_size = 64, \
.key_size = { \
.min = 0, \
.max = 0, \
.increment = 0 \
}, \
.digest_size = { \
.min = 1, \
.max = 20, \
.increment = 1 \
}, \
.iv_size = { 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
Hi Adam, Anoob,
Quoted 84 lines
Quoted 50 lines
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Adam Dybkowski
Sent: Monday, May 18, 2020 7:54 PM
To: [email protected]; [email protected]; [email protected]
Cc: Adam Dybkowski <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentThis patch fixes improper SHA-1 digest size in the enum comment.
Fixes 1bd407fac80b ("cryptodev: extract symmetric operations")Signed-off-by Adam Dybkowski <[email protected]>--- lib/librte_cryptodev/rte_crypto_sym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/librte_cryptodev/rte_crypto_sym.h +0
-0@@ -269,9 +269,9 @@ enum rte_crypto_auth_algorithm {/**< HMAC using MD5 algorithm */ Quoted 12 lines
Quoted 11 lines
lib/librte_cryptodev/rte_crypto_sym.h enum rte_crypto_auth_algorithm { · line 274
Quoted 6 lines
lib/librte_cryptodev/rte_crypto_sym.h +2
-2RTE_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
_html_rfc2404&d=DwIFAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=jPfB8rwwviRSxyL Ws2
Quoted 2 lines
n6B-
WYLn1v9SyTMrT5EQqh2TU&m=pgqB2BfFosCF_7l1SdoodgXcipf7G1ofht68ZK Mt
Quoted 1 line
oW0&s=hxzUN2QfRJGaR7NQ7VKGm5oQvOZez6Z70mqOyg7gKTY&e= )
treated as a
Quoted 3 lines
separate algorithm or is it a digest size variant of
RTE_CRYPTO_AUTH_SHA1_HMAC? I assume the later.Quoted 8 lines
Quoted 4 lines
[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 = RTE_CRYPTO_OP_TYPE_SYMMETRIC, \ {.sym = { \ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, \ {.auth = { \ .algo = RTE_CRYPTO_AUTH_SHA1, \ .block_size = 64, \ .key_size = { \ .min = 0, \ .max = 0, \ .increment = 0 \ }, \ .digest_size = { \ .min = 1, \ .max = 20, \ .increment = 1 \ }, \ .iv_size = { 0 } \ }, } \ }, } \ }, \
Quoted 6 lines
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
/**< HMAC using 160 bit SHA algorithm.
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.
Hi Fiona,
Please see inline.
Thanks,
Anoob
Quoted 115 lines
-----Original Message-----
From: Trahe, Fiona <[email protected]>
Sent: Tuesday, May 19, 2020 3:59 PM
To: Dybkowski, AdamX <[email protected]>; Anoob Joseph <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Trahe, Fiona <[email protected]>
Subject: [EXT] RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentExternal Email
----------------------------------------------------------------------
Hi Adam, Anoob,Quoted 59 lines
Quoted 59 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Adam Dybkowski
Sent: Monday, May 18, 2020 7:54 PM
To: [email protected]; [email protected]; [email protected]
Cc: Adam Dybkowski <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentThis patch fixes improper SHA-1 digest size in the enum comment.
Fixes 1bd407fac80b ("cryptodev: extract symmetricoperations")
Cc: [email protected]Signed-off-by Adam Dybkowski <[email protected]>--- lib/librte_cryptodev/rte_crypto_sym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/librte_cryptodev/rte_crypto_sym.h +0
-0@@ -269,9 +269,9 @@ enum rte_crypto_auth_algorithm {/**< HMAC using MD5 algorithm */ Quoted 13 lines
Quoted 12 lines
lib/librte_cryptodev/rte_crypto_sym.h enum rte_crypto_auth_algorithm { · line 274
Quoted 6 lines
lib/librte_cryptodev/rte_crypto_sym.h +2
-2RTE_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
_html_rfc2404&d=DwIFAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=jPfB8rwwviRSxyL Ws2
Quoted 2 lines
n6B-
WYLn1v9SyTMrT5EQqh2TU&m=pgqB2BfFosCF_7l1SdoodgXcipf7G1ofht68ZK Mt
Quoted 1 line
oW0&s=hxzUN2QfRJGaR7NQ7VKGm5oQvOZez6Z70mqOyg7gKTY&e= )
treated as a
Quoted 9 lines
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 authQuoted 7 lines
Quoted 4 lines
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:
Quoted 3 lines
{ /* SHA1 */ \ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\Quoted 2 lines
{.sym = { \ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\Quoted 2 lines
{.auth = { \ .algo = RTE_CRYPTO_AUTH_SHA1,\Quoted 16 lines
.block_size = 64, \ .key_size = { \ .min = 0, \ .max = 0, \ .increment = 0 \ }, \ .digest_size = { \ .min = 1, \ .max = 20, \ .increment = 1 \ }, \ .iv_size = { 0 } \ }, } \ }, } \ }, \Quoted 1 line
It shows QAT PMD is able to truncate the output digest to any size from 1 to
20 bytes (160 bits).
Quoted 5 lines
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
Quoted 8 lines
[Fiona] True. But as 96 bits is a standard variant described in the spec, how about adding
/**< HMAC using 160 bit SHA algorithm.
HMAC-SHA-1-96 can be generated by settingdigest_sizeto 12 */This doesn't imply that all PMDs must support that - same as for any other 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 bytes). So the comment in the spec/library is accurate, but QAT has digest size of 1-28 bytes. Is that correct? The comment in the spec says, "224 bit SHA algorithm" but if other digest sizes are supported, that comment becomes invalid, right?
Quoted 112 lines
-----Original Message-----
From: Trahe, Fiona <[email protected]>
Sent: Tuesday, 19 May, 2020 12:29
To: Dybkowski, AdamX <[email protected]>; Anoob Joseph <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Trahe, Fiona <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentHi Adam, Anoob,
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Adam Dybkowski
Sent: Monday, May 18, 2020 7:54 PM
To: [email protected]; [email protected]; [email protected]
Cc: Adam Dybkowski <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] cryptodev: fix SHA-1 digest enum commentThis patch fixes improper SHA-1 digest size in the enum comment.
Fixes 1bd407fac80b ("cryptodev: extract symmetricoperations")
Cc: [email protected]Signed-off-by Adam Dybkowski <[email protected]>--- lib/librte_cryptodev/rte_crypto_sym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/librte_cryptodev/rte_crypto_sym.h +0
-0@@ -269,9 +269,9 @@ enum rte_crypto_auth_algorithm {/**< HMAC using MD5 algorithm */ Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
lib/librte_cryptodev/rte_crypto_sym.h +1
-2RTE_CRYPTO_AUTH_SHA1 , -/**< 128 bit SHA algorithm. */ +/**< 160 bit SHA algorithm. */ RTE_CRYPTO_AUTH_SHA1_HMAC, -/**< HMAC using 128 bit SHA algorithm. */ Quoted 9 lines
Quoted 8 lines
Quoted 7 lines
lib/librte_cryptodev/rte_crypto_sym.h enum rte_crypto_auth_algorithm { · line 274
Quoted 1 line
lib/librte_cryptodev/rte_crypto_sym.h +1
-0+/**< 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
_html_rfc2404&d=DwIFAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=jPfB8rwwviRSxyL
Quoted 4 lines
Quoted 4 lines
Ws2
Quoted 2 lines
n6B-
WYLn1v9SyTMrT5EQqh2TU&m=pgqB2BfFosCF_7l1SdoodgXcipf7G1ofht68ZK
Quoted 12 lines
Quoted 12 lines
Mt
Quoted 1 line
oW0&s=hxzUN2QfRJGaR7NQ7VKGm5oQvOZez6Z70mqOyg7gKTY&e= )
treated as a
Quoted 9 lines
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 authQuoted 7 lines
Quoted 4 lines
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:
Quoted 3 lines
{ /* SHA1 */ \ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\Quoted 2 lines
{.sym = { \ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\Quoted 2 lines
{.auth = { \ .algo = RTE_CRYPTO_AUTH_SHA1,\Quoted 16 lines
.block_size = 64, \ .key_size = { \ .min = 0, \ .max = 0, \ .increment = 0 \ }, \ .digest_size = { \ .min = 1, \ .max = 20, \ .increment = 1 \ }, \ .iv_size = { 0 } \ }, } \ }, } \ }, \Quoted 1 line
It shows QAT PMD is able to truncate the output digest to any size from 1
to 20 bytes (160 bits).
Quoted 4 lines
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.
Quoted 6 lines
Quoted 1 line
Adam
[Fiona] True. But as 96 bits is a standard variant described in the spec, how about adding
/**< HMAC using 160 bit SHA algorithm.
HMAC-SHA-1-96 can be generated by settingdigest_sizeto 12 */
[Adam] OK, sent this update as v2.
Quoted 2 lines
This doesn't imply that all PMDs must support that - same as for any other feature, the capabilities can vary.