linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: "Lucas Stach" <l.stach@pengutronix.de>,
	"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
	<linux-crypto@vger.kernel.org>, "Chris Healy" <cphealy@gmail.com>,
	"Horia Geantă" <horia.geanta@nxp.com>,
	"Iuliana Prodan" <iuliana.prodan@nxp.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/3] enable CAAM's HWRNG as default
Date: Wed, 13 Nov 2019 07:17:27 +0800	[thread overview]
Message-ID: <20191112231727.bzgh42lc333gu4eu@gondor.apana.org.au> (raw)
In-Reply-To: <CAHQ1cqGAtw5UVqGbr-05Tg0V9bXRRyP6SjqrXCiuwmLbgRrOBA@mail.gmail.com>

On Tue, Nov 12, 2019 at 07:13:02AM -0800, Andrey Smirnov wrote:
>
> If I am reading the datasheet right reseeding should be done every
> time CAAM is asked to generated random data.

If you can guarantee that everytime the driver reads n bytes from
the hardware, that the hardware is then reseeded with nbytes prior
to that read, then it should be good enough.

If the hardware only reseeds afterwards or reseeds with less than
n bytes then it is not sufficient.
 
> Even if prediction resistance is an acceptable approach, would it be
> better to expose underlying TRNG and downgrade current CAAM hwrng code
> to crypto rng API? If that's the best path forward, I am more than
> happy to go that way in v2.

If it offers true prediction resistance it should be good enough
to use the drivers/char/hw_random interface.  Otherwise please
switch to the Crypto API RNG interface.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2019-11-12 23:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 16:29 [PATCH 0/3] enable CAAM's HWRNG as default Andrey Smirnov
2019-10-29 16:29 ` [PATCH 1/3] crypto: caam - RNG4 TRNG errata Andrey Smirnov
2019-10-29 16:29 ` [PATCH 2/3] crypto: caam - enable prediction resistance in HRWNG Andrey Smirnov
2019-10-29 16:29 ` [PATCH 3/3] crypto: caam - set hwrng quality level Andrey Smirnov
2019-10-29 16:43 ` [PATCH 0/3] enable CAAM's HWRNG as default Lucas Stach
2019-10-29 19:58   ` Andrey Smirnov
2019-11-08 15:19     ` Herbert Xu
2019-11-12 15:13       ` Andrey Smirnov
2019-11-12 23:17         ` Herbert Xu [this message]
2019-11-08 15:14 ` 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=20191112231727.bzgh42lc333gu4eu@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=andrew.smirnov@gmail.com \
    --cc=cphealy@gmail.com \
    --cc=horia.geanta@nxp.com \
    --cc=iuliana.prodan@nxp.com \
    --cc=l.stach@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).