Re: [PATCH 5/7] random: replace non-blocking pool with a Chacha20-based CRNG

From: Herbert Xu
Date: Wed Jun 15 2016 - 10:59:22 EST


On Mon, Jun 13, 2016 at 11:48:37AM -0400, Theodore Ts'o wrote:
> The CRNG is faster, and we don't pretend to track entropy usage in the
> CRNG any more.
>
> Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
> ---
> crypto/chacha20_generic.c | 61 --------
> drivers/char/random.c | 374 +++++++++++++++++++++++++++++++++-------------
> include/crypto/chacha20.h | 1 +
> lib/Makefile | 2 +-
> lib/chacha20.c | 79 ++++++++++
> 5 files changed, 353 insertions(+), 164 deletions(-)
> create mode 100644 lib/chacha20.c
>
> diff --git a/crypto/chacha20_generic.c b/crypto/chacha20_generic.c
> index da9c899..1cab831 100644
> --- a/crypto/chacha20_generic.c
> +++ b/crypto/chacha20_generic.c

I think you should be accessing this through the crypto API rather
than going direct. We already have at least one accelerated
implementation of chacha20 and there may well be more of them
in future. Going through the crypto API means that you will
automatically pick up the best implementation for the platform.

Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt