diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2022-01-28 08:02:54 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2022-02-05 05:10:51 +0100 |
commit | a43bed8220f26178f0f63bf4c0fc23b7b8b76763 (patch) | |
tree | f7158f7fc205e9aaa189a831f462e87877090f71 /drivers/crypto/atmel-aes.c | |
parent | crypto: arm64/aes-neonbs-xts - use plain NEON for non-power-of-2 input sizes (diff) | |
download | linux-a43bed8220f26178f0f63bf4c0fc23b7b8b76763.tar.xz linux-a43bed8220f26178f0f63bf4c0fc23b7b8b76763.zip |
hwrng: core - credit entropy for low quality sources of randomness
In case the entropy quality is low, there may be less than one bit to
credit in the call to add_hwgenerator_randomness(): The number of bytes
returned by rng_get_data() multiplied by the current quality (in entropy
bits per 1024 bits of input) must be larger than 128 to credit at least
one bit. However, imx-rngc.c sets the quality to 19, but may return less
than 32 bytes; hid_u2fzero.c sets the quality to 1; and users may override
the quality setting manually.
In case there is less than one bit to credit, keep track of it and add
that credit to the next iteration.
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-aes.c')
0 files changed, 0 insertions, 0 deletions