[PATCH] crypto: chacha20 - use rol32() macro from bitops.h

2017-12-31 Thread Eric Biggers
From: Eric Biggers For chacha20_block(), use the existing 32-bit left-rotate function instead of defining one ourselves. Signed-off-by: Eric Biggers --- lib/chacha20.c | 69 +++--- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git

[PATCH 1/3] crypto: salsa20-generic - cleanup and convert to skcipher API

2017-12-31 Thread Eric Biggers
From: Eric Biggers Convert salsa20-generic from the deprecated "blkcipher" API to the "skcipher" API, in the process fixing it up to be thread-safe (as the crypto API expects) by maintaining each request's state separately from the transform context. Also remove the unnecessary cra_alignmask and

[PATCH 2/3] crypto: salsa20 - export generic helpers

2017-12-31 Thread Eric Biggers
From: Eric Biggers Export the Salsa20 constants, transform context, and initialization functions so that they can be reused by the x86 implementation. Signed-off-by: Eric Biggers --- crypto/salsa20_generic.c | 20 +++- include/crypto/salsa20.h | 27 +++

[PATCH 0/3] crypto: salsa20 - cleanup and convert to skcipher API

2017-12-31 Thread Eric Biggers
This series converts the Salsa20 implementations over to the skcipher API, in the process fixing a couple bugs and making them be more similar to the ChaCha20 implementations, rather than doing things slightly differently for no good reason. (Note, however, that Salsa20 still interprets the IV dif

[PATCH 3/3] crypto: x86/salsa20 - cleanup and convert to skcipher API

2017-12-31 Thread Eric Biggers
From: Eric Biggers Convert salsa20-asm from the deprecated "blkcipher" API to the "skcipher" API, in the process fixing it up to use the generic helpers. This allows removing the salsa20_keysetup() and salsa20_ivsetup() assembly functions, which aren't performance critical; the C versions do just

Re: [PATCH] crypto: Use zeroing memory allocator instead of allocator/memset

2017-12-31 Thread Julia Lawall
On Sun, 31 Dec 2017, Himanshu Jha wrote: > On Sun, Dec 31, 2017 at 07:46:09AM -0800, Joe Perches wrote: > > On Sun, 2017-12-31 at 17:54 +0530, Himanshu Jha wrote: > > > Use dma_zalloc_coherent for allocating zeroed > > > memory and remove unnecessary memset function. > > > > > > Done using Cocci

Re: [PATCH] crypto: Use zeroing memory allocator instead of allocator/memset

2017-12-31 Thread Himanshu Jha
On Sun, Dec 31, 2017 at 07:46:09AM -0800, Joe Perches wrote: > On Sun, 2017-12-31 at 17:54 +0530, Himanshu Jha wrote: > > Use dma_zalloc_coherent for allocating zeroed > > memory and remove unnecessary memset function. > > > > Done using Coccinelle. > > Generated-by: scripts/coccinelle/api/alloc/k

Re: [PATCH] crypto: Use zeroing memory allocator instead of allocator/memset

2017-12-31 Thread Joe Perches
On Sun, 2017-12-31 at 17:54 +0530, Himanshu Jha wrote: > Use dma_zalloc_coherent for allocating zeroed > memory and remove unnecessary memset function. > > Done using Coccinelle. > Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci I thought you were going to change this tag to not u

[PATCH] crypto: Use zeroing memory allocator instead of allocator/memset

2017-12-31 Thread Himanshu Jha
Use dma_zalloc_coherent for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Signed-off-by: Himanshu Jha --- drivers/crypto/amcc/crypto4xx_core.c | 8 +++- d