linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: DRBG - switch to HMAC SHA512 DRBG as default DRBG
@ 2021-05-20 19:31 Stephan Müller
  2021-05-20 20:05 ` Simo Sorce
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stephan Müller @ 2021-05-20 19:31 UTC (permalink / raw)
  To: linux-crypto; +Cc: herbert

The default DRBG is the one that has the highest priority. The priority
is defined based on the order of the list drbg_cores[] where the highest
priority is given to the last entry by drbg_fill_array.

With this patch the default DRBG is switched from HMAC SHA256 to HMAC
SHA512 to support compliance with SP800-90B and SP800-90C (current
draft).

The user of the crypto API is completely unaffected by the change.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
 crypto/drbg.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/crypto/drbg.c b/crypto/drbg.c
index 1b4587e0ddad..ea85d4a0fe9e 100644
--- a/crypto/drbg.c
+++ b/crypto/drbg.c
@@ -176,18 +176,18 @@ static const struct drbg_core drbg_cores[] = {
 		.blocklen_bytes = 48,
 		.cra_name = "hmac_sha384",
 		.backend_cra_name = "hmac(sha384)",
-	}, {
-		.flags = DRBG_HMAC | DRBG_STRENGTH256,
-		.statelen = 64, /* block length of cipher */
-		.blocklen_bytes = 64,
-		.cra_name = "hmac_sha512",
-		.backend_cra_name = "hmac(sha512)",
 	}, {
 		.flags = DRBG_HMAC | DRBG_STRENGTH256,
 		.statelen = 32, /* block length of cipher */
 		.blocklen_bytes = 32,
 		.cra_name = "hmac_sha256",
 		.backend_cra_name = "hmac(sha256)",
+	}, {
+		.flags = DRBG_HMAC | DRBG_STRENGTH256,
+		.statelen = 64, /* block length of cipher */
+		.blocklen_bytes = 64,
+		.cra_name = "hmac_sha512",
+		.backend_cra_name = "hmac(sha512)",
 	},
 #endif /* CONFIG_CRYPTO_DRBG_HMAC */
 };
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-28  3:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 19:31 [PATCH] crypto: DRBG - switch to HMAC SHA512 DRBG as default DRBG Stephan Müller
2021-05-20 20:05 ` Simo Sorce
2021-05-28  7:26 ` Herbert Xu
2021-06-24 14:30 ` Herbert Xu
2021-06-24 14:54   ` Stephan Mueller
2021-06-24 15:44   ` [PATCH] crypto: DRBG - self test for HMAC(SHA-512) Stephan Müller
     [not found]     ` <CAMusb+TVdPRtDCY88kREZgWNH8XtrJS4yLkK3UJFqhXgn36raw@mail.gmail.com>
2021-06-24 20:56       ` Vlad Dronov
2021-06-28  3:31     ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).