linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] crypto: caam - set hwrng quality level
@ 2017-07-19  7:44 Oleksij Rempel
  2017-07-19 12:49 ` Horia Geantă
  0 siblings, 1 reply; 11+ messages in thread
From: Oleksij Rempel @ 2017-07-19  7:44 UTC (permalink / raw)
  To: kernel, Horia Geantă, Dan Douglass, Herbert Xu,
	David S. Miller, linux-crypto, linux-kernel
  Cc: Oleksij Rempel

According documentation, it is NIST certified TRNG.
So, set high quality to let the HWRNG framework automatically use it.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/crypto/caam/caamrng.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c
index 41398da3edf4..684c0bc88dfd 100644
--- a/drivers/crypto/caam/caamrng.c
+++ b/drivers/crypto/caam/caamrng.c
@@ -292,10 +292,16 @@ static int caam_init_rng(struct caam_rng_ctx *ctx, struct device *jrdev)
 	return 0;
 }
 
+/*
+ * hwrng register struct
+ * The trng is suppost to have 100% entropy, and thus
+ * we register with a very high quality value.
+ */
 static struct hwrng caam_rng = {
 	.name		= "rng-caam",
 	.cleanup	= caam_cleanup,
 	.read		= caam_read,
+	.quality	= 999,
 };
 
 static void __exit caam_rng_exit(void)
-- 
2.11.0

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

end of thread, other threads:[~2017-08-09  4:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-19  7:44 [PATCH v1] crypto: caam - set hwrng quality level Oleksij Rempel
2017-07-19 12:49 ` Horia Geantă
2017-07-19 16:32   ` Oleksij Rempel
2017-07-19 16:53     ` Horia Geantă
2017-07-19 18:13       ` Oleksij Rempel
2017-07-20 13:08         ` Harald Freudenberger
2017-08-02 14:03           ` Horia Geantă
2017-08-03  3:16             ` Herbert Xu
2017-08-03  7:48               ` Horia Geantă
2017-08-03  9:26                 ` Oleksij Rempel
2017-08-09  4:56                 ` 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).