lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 5 Oct 2018 10:27:16 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     "Michael S. Tsirkin" <mst@...hat.com>
Cc:     linux-kernel@...r.kernel.org, Matt Mackall <mpm@...enic.com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        matthias.bgg@...il.com, Liam.Merwick@...cle.com,
        Jim.Quigley@...cle.com, linux-crypto@...r.kernel.org,
        Cornelia Huck <cornelia.huck@...ibm.com>, dgilbert@...hat.com
Subject: Re: [PATCH] hwrng: document the quality field

On Tue, Sep 25, 2018 at 12:35:18PM -0400, Michael S. Tsirkin wrote:
> quality field is currently documented as being 'per mill'.  In fact the
> math involved is:
> 
>                 add_hwgenerator_randomness((void *)rng_fillbuf, rc,
>                                            rc * current_quality * 8 >> 10);
> 
> thus the actual definition is "bits of entropy per 1024 bits of input".
> 
> The current documentation seems to have confused multiple people
> in the past, let's fix the documentation to match code.
> 
> An alternative is to change core to match driver expectations, replacing
> 	rc * current_quality * 8 >> 10
> with
> 	rc * current_quality / 1000
> but that has performance costs, so probably isn't a good option.
> 
> Fixes: 0f734e6e768 ("hwrng: add per-device entropy derating")
> Reported-by: "Dr. David Alan Gilbert" <dgilbert@...hat.com>
> Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> ---
> 
> 
>  drivers/char/hw_random/core.c | 4 ++--
>  include/linux/hw_random.h     | 3 ++-
>  2 files changed, 4 insertions(+), 3 deletions(-)

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ