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

2016-06-19 Thread Herbert Xu
On Mon, Jun 20, 2016 at 01:02:03AM -0400, Theodore Ts'o wrote: > > It's work that I'm not convinced is worth the gain? Perhaps I > shouldn't have buried the lede, but repeating a paragraph from later > in the message: > >So even if the AVX optimized is 100% faster than the generic version, >

Re: [PATCH v5 0/7] /dev/random - a new approach

2016-06-19 Thread Stephan Mueller
Am Sonntag, 19. Juni 2016, 21:36:14 schrieb Pavel Machek: Hi Pavel, > On Sun 2016-06-19 17:58:41, Stephan Mueller wrote: > > Hi Herbert, Ted, > > > > The following patch set provides a different approach to /dev/random which > > I call Linux Random Number Generator (LRNG) to collect entropy with

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

2016-06-19 Thread Theodore Ts'o
On Mon, Jun 20, 2016 at 09:25:28AM +0800, Herbert Xu wrote: > > Yes, I understand the argument that the networking stack is now > > requiring the crypto layer --- but not all IOT devices may necessarily > > require the IP stack (they might be using some alternate wireless > > communications stack)

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

2016-06-19 Thread Herbert Xu
On Sun, Jun 19, 2016 at 07:18:28PM -0400, Theodore Ts'o wrote: > > C) Simply compiling in the Crypto layer and the ChaCha20 generic > handling (all of which is doing extra work which we would then be > undoing in the random layer --- and I haven't included the extra code > in the random driver need

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

2016-06-19 Thread Theodore Ts'o
On Wed, Jun 15, 2016 at 10:59:08PM +0800, Herbert Xu wrote: > 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

Re: [PATCH v5 0/7] /dev/random - a new approach

2016-06-19 Thread Sandy Harris
On Sun, Jun 19, 2016 at 3:36 PM, Pavel Machek wrote: >> The following patch set provides a different approach to /dev/random ... > > Dunno. It is very similar to existing rng, AFAICT. I do not think so. A lot of the basic principles are the same of course, but Stephan is suggesting some real cha

Re: [PATCH v5 0/7] /dev/random - a new approach

2016-06-19 Thread Pavel Machek
On Sun 2016-06-19 17:58:41, Stephan Mueller wrote: > Hi Herbert, Ted, > > The following patch set provides a different approach to /dev/random which > I call Linux Random Number Generator (LRNG) to collect entropy within the > Linux > kernel. The main improvements compared to the legacy /dev/rand

Re: [PATCH v5 3/7] crypto: Linux Random Number Generator

2016-06-19 Thread Stephan Mueller
Am Sonntag, 19. Juni 2016, 09:58:55 schrieb Andi Kleen: Hi Andi, > On Sun, Jun 19, 2016 at 06:00:21PM +0200, Stephan Mueller wrote: > > The LRNG with all its properties is documented in [1]. This > > documentation covers the functional discussion as well as testing of all > > aspects of entropy p

Re: [PATCH v5 3/7] crypto: Linux Random Number Generator

2016-06-19 Thread Andi Kleen
On Sun, Jun 19, 2016 at 06:00:21PM +0200, Stephan Mueller wrote: > The LRNG with all its properties is documented in [1]. This > documentation covers the functional discussion as well as testing of all > aspects of entropy processing. In addition, the documentation explains > the conducted regressi

[PATCH v5 3/7] crypto: Linux Random Number Generator

2016-06-19 Thread Stephan Mueller
The LRNG with all its properties is documented in [1]. This documentation covers the functional discussion as well as testing of all aspects of entropy processing. In addition, the documentation explains the conducted regression tests to verify that the LRNG is API and ABI compatible with the legac

[PATCH v5 4/7] crypto: LRNG - enable compile

2016-06-19 Thread Stephan Mueller
Add LRNG compilation support. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 11 +++ crypto/Makefile | 2 ++ 2 files changed, 13 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index c903f18..772d430 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -1589,6 +1589,17

[PATCH v5 1/7] crypto: DRBG - externalize DRBG functions for LRNG

2016-06-19 Thread Stephan Mueller
This patch allows several DRBG functions to be called by the LRNG kernel code paths outside the drbg.c file. Signed-off-by: Stephan Mueller --- crypto/drbg.c | 11 +-- include/crypto/drbg.h | 7 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/crypto/drbg.

[PATCH v5 4/7] crypto: LRNG - enable compile

2016-06-19 Thread Stephan Mueller
The Hyper-V Linux Integration Services use the VMBus implementation for communication with the Hypervisor. VMBus registers its own interrupt handler that completely bypasses the common Linux interrupt handling. This implies that the interrupt entropy collector is not triggered. This patch adds the

[PATCH v5 7/7] crypto: LRNG - add ChaCha20 support

2016-06-19 Thread Stephan Mueller
In case the kernel crypto API is not compiled, use ChaCha20 stream cipher as DRNG. The LRNG ChaCha20 support provides the DRNG implementation with the generate and update functions. Further documentation is provided in [1]. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 2 +- cr

[PATCH v5 6/7] crypto: isolate the chacha20_block function

2016-06-19 Thread Stephan Mueller
The chacha20_block function is extracted into its separate C file to allow it to be used by other callers. Signed-off-by: Stephan Mueller --- crypto/Kconfig| 4 +++ crypto/Makefile | 1 + crypto/chacha20_block.c | 79 +++ cryp

[PATCH v5 2/7] random: conditionally compile code depending on LRNG

2016-06-19 Thread Stephan Mueller
When selecting the LRNG for compilation, disable the legacy /dev/random implementation. The LRNG is a drop-in replacement for the legacy /dev/random which implements the same in-kernel and user space API. Only the hooks of /dev/random into other parts of the kernel need to be disabled. Signed-off

[PATCH v5 0/7] /dev/random - a new approach

2016-06-19 Thread Stephan Mueller
Hi Herbert, Ted, The following patch set provides a different approach to /dev/random which I call Linux Random Number Generator (LRNG) to collect entropy within the Linux kernel. The main improvements compared to the legacy /dev/random is to provide sufficient entropy during boot time as well as