linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: kernel@pengutronix.de, "Horia Geantă" <horia.geanta@nxp.com>,
	"Dan Douglass" <dan.douglass@nxp.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Subject: [PATCH v1] crypto: caam - set hwrng quality level
Date: Wed, 19 Jul 2017 09:44:58 +0200	[thread overview]
Message-ID: <20170719074458.9247-1-o.rempel@pengutronix.de> (raw)

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

             reply	other threads:[~2017-07-19  7:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19  7:44 Oleksij Rempel [this message]
2017-07-19 12:49 ` [PATCH v1] crypto: caam - set hwrng quality level 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170719074458.9247-1-o.rempel@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=dan.douglass@nxp.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).