Skip to contentSkip to conversation

crypto: atmel-sha204a - Set hwrng quality to lowest possible

PATCH New Marek Behún 1 participant 1 message Apr 29, 2025 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: atmel-sha204a - Set hwrng quality to lowest possible

commit 8006aff15516a170640239c5a8e6696c0ba18d8e upstream.

According to the review by Bill Cox [1], the Atmel SHA204A random number generator produces random numbers with very low entropy.

Set the lowest possible entropy for this chip just to be safe.

[1] https://www.metzdowd.com/pipermail/cryptography/2014-December/023858.html

Fixes da001fb651b00e1d ("crypto: atmel-i2c - add support for SHA204A random number generator")
[ rebased for 5.15 ]
---
 drivers/crypto/atmel-sha204a.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/crypto/atmel-sha204a.c +6 -1
index c96c14e7dab1..0ef92109ce22 100644
@@ -107,7 +107,12 @@ static int atmel_sha204a_probe(struct i2c_client *client,
 
 	i2c_priv->hwrng.name = dev_name(&client->dev);
 	i2c_priv->hwrng.read = atmel_sha204a_rng_read;
-	i2c_priv->hwrng.quality = 1024;
+
+	/*
+	 * According to review by Bill Cox [1], this HWRNG has very low entropy.
+	 * [1] https://www.metzdowd.com/pipermail/cryptography/2014-December/023858.html
+	 */
+	i2c_priv->hwrng.quality = 1;
 
 	ret = devm_hwrng_register(&client->dev, &i2c_priv->hwrng);
 	if (ret)
Signature · 1 line
2.49.0