crypto: caam - limit single JD RNG output to maximum of 16 bytes
authorAndrey Smirnov <andrew.smirnov@gmail.com>
Thu, 19 Mar 2020 16:12:33 +0000 (09:12 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 30 Mar 2020 00:50:50 +0000 (11:50 +1100)
commitea53756d831a1a5db3ca00a12747365e2fcb4bd8
treed794c789f1944ea429ae19b8915c0b0804d5a912
parent358ba762d9f1d4ba99ab31ef12bc28014b22f4c9
crypto: caam - limit single JD RNG output to maximum of 16 bytes

In order to follow recommendation in SP800-90C (section "9.4 The
Oversampling-NRBG Construction") limit the output of "generate" JD
submitted to CAAM. See
https://lore.kernel.org/linux-crypto/VI1PR0402MB3485EF10976A4A69F90E5B0F98580@VI1PR0402MB3485.eurprd04.prod.outlook.com/
for more details.

This change should make CAAM's hwrng driver good enough to have 1024
quality rating.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Horia Geantă <horia.geanta@nxp.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Iuliana Prodan <iuliana.prodan@nxp.com>
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-imx@nxp.com
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamrng.c