Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: "Stephan Müller" <smueller@chronox.de>
To: Stefan Wahren <stefan.wahren@i2se.com>,
	Lukasz Stelmach <l.stelmach@samsung.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Scott Branden <sbranden@broadcom.com>,
	Matthias Brugger <mbrugger@suse.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Matt Mackall <mpm@selenic.com>,
	linux-kernel@vger.kernel.org,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-samsung-soc@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Kukjin Kim <kgene@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	linux-crypto@vger.kernel.org, Ray Jui <rjui@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Markus Elfring <elfring@users.sourceforge.net>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/2] hwrng: iproc-rng200 - Set the quality value
Date: Sat, 23 May 2020 20:46:26 +0200
Message-ID: <3080190.aeNJFYEL58@positron.chronox.de> (raw)
In-Reply-To: <dleftjftbtyubp.fsf%l.stelmach@samsung.com>

Am Donnerstag, 21. Mai 2020, 21:14:02 CEST schrieb Lukasz Stelmach:

Hi Lukasz,

> It was <2020-05-21 czw 13:00>, when Stefan Wahren wrote:
> > Hi Lukasz,
> > 
> > Am 19.05.20 um 23:25 schrieb Łukasz Stelmach:
> >> The value was estimaded with ea_iid[1] using on 10485760 bytes read from
> >> the RNG via /dev/hwrng. The min-entropy value calculated using the most
> >> common value estimate (NIST SP 800-90P[2], section 6.3.1) was 7.964464.
> > 
> > could you please mention in the commit the used hardware
> > implementation(s) of iproc-rng200 to get this quality?
> > 
> > AFAIK there is still no public register description at least for the
> > bcm2711. So is it safe to assume that the suggested quality applies to
> > all possible configurations?
> 
> I've learnt that there is a post-processing unit in RNG200 that tests
> the output of the noise generator and fills FIFO only with data that
> passes FIPS tests. Unlike simmilar unit in Exynos, it cannot be disabled
> or bypassed. Therefore, after Stephan Mueller's thorough explanations I
> am considering dropping this patch in v3.

If you would be more clear what that FIPS test is all about, we may be able to 
identify whether it affects the entropy behavior or not. E.g. if it is the 
SP800-90B health test following SP880-90B section 4.4, this does not affect 
entropy and you could apply your calculation.
> 
> However, I stil am still not 100% convinced that it is impossible to
> assign the quality a reasonable non-zero value in such case.
> 
> > Thanks
> > Stefan
> > 
> >> [1]
> >> https://protect2.fireeye.com/url?k=da4735b2-87d99b28-da46befd-0cc47a336f
> >> ae-e1c21080bc6ab1e4&q=1&u=https%3A%2F%2Fgithub.com%2Fusnistgov%2FSP800-90
> >> B_EntropyAssessment [2]
> >> https://csrc.nist.gov/publications/detail/sp/800-90b/final
> >> 
> >> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
> >> ---
> >> 
> >>  drivers/char/hw_random/iproc-rng200.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >> 
> >> diff --git a/drivers/char/hw_random/iproc-rng200.c
> >> b/drivers/char/hw_random/iproc-rng200.c index 32d9fe61a225..95669ece050f
> >> 100644
> >> --- a/drivers/char/hw_random/iproc-rng200.c
> >> +++ b/drivers/char/hw_random/iproc-rng200.c
> >> @@ -199,6 +199,7 @@ static int iproc_rng200_probe(struct platform_device
> >> *pdev)>> 
> >>  	priv->rng.read = iproc_rng200_read,
> >>  	priv->rng.init = iproc_rng200_init,
> >>  	priv->rng.cleanup = iproc_rng200_cleanup,
> >> 
> >> +	priv->rng.quality = 1000,
> >> 
> >>  	/* Register driver */
> >>  	ret = devm_hwrng_register(dev, &priv->rng);


Ciao
Stephan



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply index

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200514190737eucas1p18ccdddb185ea7611683a6859e17bc721@eucas1p1.samsung.com>
2020-05-14 19:07 ` [PATCH 0/2] Set the quality value for two HW RNGs Łukasz Stelmach
     [not found]   ` <CGME20200514190738eucas1p2695c0d8af064ee702209ca03696ef438@eucas1p2.samsung.com>
2020-05-14 19:07     ` [PATCH 1/2] hwrng: iproc-rng200 - Set the quality value Łukasz Stelmach
2020-05-14 20:20       ` Stephan Mueller
     [not found]         ` <CGME20200514221852eucas1p2bea169d0b4467b0ec9e195c6ac58a08a@eucas1p2.samsung.com>
2020-05-14 22:18           ` Lukasz Stelmach
2020-05-15  8:32             ` Stephan Mueller
     [not found]               ` <CGME20200515090647eucas1p21018edfd835730c9a68dcb186349ee74@eucas1p2.samsung.com>
2020-05-15  9:06                 ` Lukasz Stelmach
     [not found]             ` <CGME20200515090158eucas1p1b653fc50f1ad4f0f6c92525ab3188d45@eucas1p1.samsung.com>
2020-05-15  9:01               ` Lukasz Stelmach
2020-05-15  9:10                 ` Stephan Mueller
     [not found]                   ` <CGME20200515110002eucas1p136759396d9b61f214d1f14856c009501@eucas1p1.samsung.com>
2020-05-15 10:59                     ` Lukasz Stelmach
     [not found]   ` <CGME20200514190740eucas1p293129b2ef3ba706652a9327e55db9649@eucas1p2.samsung.com>
2020-05-14 19:07     ` [PATCH 2/2] hwrng: exynos " Łukasz Stelmach
2020-05-14 20:20       ` Stephan Mueller
     [not found]   ` <CGME20200519212617eucas1p1b6e7af0ecb894896b165601fafd6abe8@eucas1p1.samsung.com>
2020-05-19 21:25     ` [PATCH v2 0/2] Set the quality value for two HW RNGs Łukasz Stelmach
     [not found]       ` <CGME20200519212619eucas1p22fa5d3db2521096dc4b79f6e53016d17@eucas1p2.samsung.com>
2020-05-19 21:25         ` [PATCH v2 1/2] hwrng: iproc-rng200 - Set the quality value Łukasz Stelmach
2020-05-20  6:23           ` Stephan Mueller
     [not found]             ` <CGME20200520091043eucas1p15ecae108007382a95b01e42241cc7a26@eucas1p1.samsung.com>
2020-05-20  9:10               ` Lukasz Stelmach
2020-05-20  9:18                 ` Stephan Mueller
     [not found]                   ` <CGME20200520104448eucas1p122e9a8ed84d5276a1b796e10ef5e1964@eucas1p1.samsung.com>
2020-05-20 10:44                     ` Lukasz Stelmach
2020-05-20 11:53                       ` Stephan Mueller
2020-05-20 12:00                         ` Krzysztof Kozlowski
2020-05-20 12:11                           ` Stephan Mueller
     [not found]                         ` <CGME20200520143211eucas1p21bd93be5c62726aa715db05bb6e7119b@eucas1p2.samsung.com>
2020-05-20 14:31                           ` Lukasz Stelmach
2020-05-20  8:18           ` Kamil Konieczny
2020-05-21 11:00           ` Stefan Wahren
     [not found]             ` <CGME20200521191415eucas1p2d112a86171b23dcf255e7da53a56f4f3@eucas1p2.samsung.com>
2020-05-21 19:14               ` Lukasz Stelmach
2020-05-23 18:46                 ` Stephan Müller [this message]
     [not found]       ` <CGME20200519212621eucas1p13279db41d930b69e115972463c994a37@eucas1p1.samsung.com>
2020-05-19 21:25         ` [PATCH v2 2/2] hwrng: exynos " Łukasz Stelmach

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=3080190.aeNJFYEL58@positron.chronox.de \
    --to=smueller@chronox.de \
    --cc=arnd@arndb.de \
    --cc=b.zolnierkie@samsung.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=elfring@users.sourceforge.net \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=l.stelmach@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mbrugger@suse.com \
    --cc=mpm@selenic.com \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=stefan.wahren@i2se.com \
    /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

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git