Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Vinod <vkoul@kernel.org>
To: Timur Tabi <timur@kernel.org>, Herbert Xu <herbert@gondor.apana.org.au>
Cc: Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	linux-crypto@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
	Matt Mackall <mpm@selenic.com>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 3/3] hwrng: msm - Add support for prng v2
Date: Fri, 29 Jun 2018 14:07:32 +0530	[thread overview]
Message-ID: <20180629083732.GB22377@vkoul-mobl> (raw)
In-Reply-To: <CAOZdJXVO-0JDvX4OdJMNCmY_BXrEenXpoWBf=Ww5uFBtXKN86A@mail.gmail.com>

On 28-06-18, 17:04, Timur Tabi wrote:
> On Thu, Jun 21, 2018 at 6:53 AM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> > On Thu, Jun 21, 2018 at 02:27:10PM +0300, Stanimir Varbanov wrote:
> 
> > So does it generate one bit of output for each bit of hardware-
> > generated entropy like /dev/random? Or does it use a hardware-
> > generated seed to power a PRNG?
> 
> I have some information to answer this question, although I'm not sure
> I can give a strict "yes/no" answer.
> 
> There are a couple relevant documents:
> 
> https://www.qualcomm.com/news/onq/2014/11/07/cryptographic-module-snapdragon-805-fips-140-2-certified
> https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp2944.pdf
> 
> I also got response from a Qualcomm employee:
> 
> "The Qualcomm random number generator used in Snapdragon chips
> consists of an entropy source coupled with the HASH-DRBG deterministic
> random bit generator from NIST Special Publication 800-90A, using
> SHA-256 as the hash function.
> 
> The entropy source is based on sampled ring oscillators.  Four ring
> oscillators are used to provide high assurance of adequate entropy.
> The entropy from the ring oscillators is conditioned using the
> 'derivation function' specified by NIST Special Publication 800-90A.
> The conditioned entropy is essentially perfect fully entropic data.
> It is used both to seed and to periodically reseed the DRGB."
> 
> My understanding is that the PRNG is a real entropy source with some
> logic used to normalize the values.  To quote: "No RNG uses data
> directly from the entropy source; bits in the output are likely
> correlated and unlikely to occur with 50% probability. The entropy
> post-processing is designed to turn dirty data in clean data."
> 
> Based on the above, it seems to me that the Qualcomm PRNG qualifies as
> a real hardware RNG and porting to algif_rng is not the correct path.

I think Stan did bring this point earlier that PRNG is compliant to
FIPS-140-2. So it can be used by rng clients for various purposes but
should not be fed to dev/random as the hw_random does.

Herbert, can you please confirm..

-- 
~Vinod

  reply	other threads:[~2018-06-29  8:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 14:12 [PATCH 0/3]: hwrng: Add support for qcpm v2 hwrng Vinod Koul
2018-06-18 14:12 ` [PATCH 1/3] hwrng: msm - Move hwrng to a table Vinod Koul
2018-06-18 15:58   ` Stephen Boyd
2018-06-18 16:54     ` Vinod
2018-06-18 14:12 ` [PATCH 2/3] dt-bindings: rng: Add new compatible qcom,prng-v2 Vinod Koul
2018-06-18 14:12 ` [PATCH 3/3] hwrng: msm - Add support for prng v2 Vinod Koul
2018-06-18 18:21   ` Bjorn Andersson
2018-06-18 20:24     ` Stephen Boyd
2018-06-19  4:06       ` Vinod
2018-06-19  4:04     ` Vinod
2018-06-19 14:28   ` Herbert Xu
2018-06-20  5:32     ` Vinod
2018-06-20 14:37       ` Herbert Xu
2018-06-20 17:45       ` PrasannaKumar Muralidharan
2018-06-21  4:17         ` Vinod
2018-06-21  9:56     ` Stanimir Varbanov
2018-06-21 10:15       ` Herbert Xu
2018-06-21 11:27         ` Stanimir Varbanov
2018-06-21 11:53           ` Herbert Xu
2018-06-22  8:27             ` Stanimir Varbanov
2018-06-22 14:38               ` Herbert Xu
2018-06-22 14:48                 ` Vinod
2018-06-22 14:50                   ` Herbert Xu
     [not found]                     ` <70ED61EB-BD3E-48D1-8B4D-D7835494C035@chronox.de>
2018-06-27  5:08                       ` Vinod
2018-06-27  6:13                         ` Stephan Mueller
2018-06-27  6:27                           ` Vinod
2018-06-27  6:43                             ` Stephan Mueller
2018-06-27  7:01                               ` Vinod
2018-06-27  7:51                                 ` Stephan Mueller
2018-06-22 15:33                 ` Stanimir Varbanov
2018-06-28 22:04             ` Timur Tabi
2018-06-29  8:37               ` Vinod [this message]
2018-07-01  6:27                 ` 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=20180629083732.GB22377@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=stanimir.varbanov@linaro.org \
    --cc=timur@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