Re: [PATCH v3 2/2] crypto: arm/aes - add some hardening against cache-timing attacks

2018-10-18 Thread Ard Biesheuvel
On 18 October 2018 at 12:37, Eric Biggers wrote: > From: Eric Biggers > > Make the ARM scalar AES implementation closer to constant-time by > disabling interrupts and prefetching the tables into L1 cache. This is > feasible because due to ARM's "free" rotations, the main tables are only > 1024 b

[PATCH] crypto: cavium/nitrox - fix a DMA pool free failure

2018-10-18 Thread Wenwen Wang
In crypto_alloc_context(), a DMA pool is allocated through dma_pool_alloc() to hold the crypto context. The meta data of the DMA pool, including the pool used for the allocation 'ndev->ctx_pool' and the base address of the DMA pool used by the device 'dma', are then stored to the beginning of the p

Re: [PATCH 3/3] crypto: ccree: add SM3 support

2018-10-18 Thread kbuild test robot
Hi Yael, Thank you for the patch! Yet something to improve: [auto build test ERROR on crypto/master] [also build test ERROR on v4.19-rc8 next-20181018] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH 3/3] crypto: ccree: add SM3 support

2018-10-18 Thread kbuild test robot
Hi Yael, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on crypto/master] [also build test WARNING on v4.19-rc8 next-20181018] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci

Re: [PATCH net-next] cxgb4: fix the error path of cxgb4_uld_register()

2018-10-18 Thread David Miller
From: Ganesh Goudar Date: Thu, 18 Oct 2018 19:34:19 +0530 > On multi adapter setup if the uld registration fails even on > one adapter, the allocated resources for the uld on all the > adapters are freed, rendering the functioning adapters unusable. > > This commit fixes the issue by freeing the

RE: [PATCH 3/3] crypto: ccree: add SM3 support

2018-10-18 Thread yael.chemla
ael CHEmla ; linux- > ker...@vger.kernel.org; Yael Chemla > Subject: Re: [PATCH 3/3] crypto: ccree: add SM3 support > > Hi Yael, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on cryptodev/master] [also build test ERROR on v4.19- > rc8 next-

Re: [PATCH v4 1/4] dt-bindings: crypto: Mention clocks for mxs-dcp

2018-10-18 Thread Rob Herring
On Wed, 17 Oct 2018 12:37:51 +, Leonard Crestez wrote: > Explicit clock enabling is required on 6sll and 6ull so mention that > standard clock bindings are used. > > Signed-off-by: Leonard Crestez > Reviewed-by: Fabio Estevam > --- > Documentation/devicetree/bindings/crypto/fsl-dcp.txt | 2

[PATCH net-next v8 15/28] zinc: Poly1305 ARM and ARM64 implementations

2018-10-18 Thread Jason A. Donenfeld
These wire Andy Polyakov's implementations up to the kernel. We make a few small changes to the assembly: - Entries and exits use the proper kernel convention macro. - CPU feature checking is done in C by the glue code, so that has been removed from the assembly. - The function names have been r

[PATCH net-next v8 14/28] zinc: import Andy Polyakov's Poly1305 ARM and ARM64 implementations

2018-10-18 Thread Jason A. Donenfeld
These NEON and non-NEON implementations come from Andy Polyakov's implementation, and are included here in raw form without modification, so that subsequent commits that fix these up for the kernel can see how it has changed. While this is CRYPTOGAMS code, the originating code for this happens to

[PATCH net-next v8 13/28] zinc: Poly1305 x86_64 implementation

2018-10-18 Thread Jason A. Donenfeld
This ports AVX, AVX-2, and AVX-512F implementations for Poly1305. The AVX-512F implementation is disabled on Skylake, due to throttling. These come from Andy Polyakov's implementation, with the following modifications from Samuel Neves: - Some cosmetic changes, like renaming labels to .Lname, co

[PATCH net-next v8 10/28] zinc: ChaCha20 MIPS32r2 implementation

2018-10-18 Thread Jason A. Donenfeld
This MIPS32r2 implementation comes from René van Dorst and me and results in a nice speedup on the usual OpenWRT targets. Signed-off-by: Jason A. Donenfeld Signed-off-by: René van Dorst Co-developed-by: René van Dorst Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: linux-m...@linux-mips

[PATCH net-next v8 11/28] zinc: Poly1305 generic C implementations and selftest

2018-10-18 Thread Jason A. Donenfeld
These two C implementations -- a 32x32 one and a 64x64 one, depending on the platform -- come from Andrew Moon's public domain poly1305-donna portable code, modified for usage in the kernel and for usage with accelerated primitives. Information: https://cr.yp.to/mac.html Signed-off-by: Jason A. D

[PATCH net-next v8 12/28] zinc: import Andy Polyakov's Poly1305 x86_64 implementation

2018-10-18 Thread Jason A. Donenfeld
These x86_64 vectorized implementations come from Andy Polyakov's implementation, and are included here in raw form without modification, so that subsequent commits that fix these up for the kernel can see how it has changed. While this is CRYPTOGAMS code, the originating code for this happens to

[PATCH net-next v8 05/28] zinc: import Andy Polyakov's ChaCha20 x86_64 implementation

2018-10-18 Thread Jason A. Donenfeld
These x86_64 vectorized implementations come from Andy Polyakov's implementation, and are included here in raw form without modification, so that subsequent commits that fix these up for the kernel can see how it has changed. While this is CRYPTOGAMS code, the originating code for this happens to

[PATCH net-next v8 09/28] zinc: ChaCha20 ARM and ARM64 implementations

2018-10-18 Thread Jason A. Donenfeld
These wire Andy Polyakov's implementations up to the kernel for ARMv7,8 NEON, and introduce Eric Biggers' ultra-fast scalar implementation for CPUs without NEON or for CPUs with slow NEON (Cortex-A5,7). This commit does the following: - Adds the glue code for the assembly implementations. - Re

[PATCH net-next v8 04/28] zinc: ChaCha20 generic C implementation and selftest

2018-10-18 Thread Jason A. Donenfeld
This implements the ChaCha20 permutation as a single C statement, by way of the comma operator, which the compiler is able to simplify terrifically. Information: https://cr.yp.to/chacha.html Signed-off-by: Jason A. Donenfeld Cc: Samuel Neves Cc: Jean-Philippe Aumasson Cc: Andy Lutomirski Cc:

[PATCH net-next v8 08/28] zinc: port Andy Polyakov's ChaCha20 ARM and ARM64 implementations

2018-10-18 Thread Jason A. Donenfeld
These port and prepare Andy Polyakov's implementations for the kernel, but don't actually wire up any of the code yet. The wiring will be done in a subsequent commit, since we'll need to merge these implementations with another one. We make a few small changes to the assembly: - Entries and exit

[PATCH net-next v8 02/28] asm: simd context helper API

2018-10-18 Thread Jason A. Donenfeld
Sometimes it's useful to amortize calls to XSAVE/XRSTOR and the related FPU/SIMD functions over a number of calls, because FPU restoration is quite expensive. This adds a simple header for carrying out this pattern: simd_context_t simd_context; simd_get(&simd_context); while ((item =

[PATCH net-next v8 01/28] ARM: makefile: use ARMv3M mode for RiscPC

2018-10-18 Thread Jason A. Donenfeld
The purpose of CONFIG_CPU_32v3 is to avoid ldrh/strh on the RiscPC, which is pretty much an ARMv4 device, except its bus will choke on the half-words. The way to make the C compiler not output ldrh/strh is with -march=armv3, which doesn't support them in the ISA. However, this prevents certain cryp

[PATCH net-next v8 20/28] zinc: BLAKE2s x86_64 implementation

2018-10-18 Thread Jason A. Donenfeld
These implementations from Samuel Neves support AVX and AVX-512VL. Originally this used AVX-512F, but Skylake thermal throttling made AVX-512VL more attractive and possible to do with negligable difference. Signed-off-by: Jason A. Donenfeld Signed-off-by: Samuel Neves Co-developed-by: Samuel Nev

[PATCH net-next v8 19/28] zinc: BLAKE2s generic C implementation and selftest

2018-10-18 Thread Jason A. Donenfeld
The C implementation was originally based on Samuel Neves' public domain reference implementation but has since been heavily modified for the kernel. We're able to do compile-time optimizations by moving some scaffolding around the final function into the header file. Information: https://blake2.n

[PATCH net-next v8 26/28] crypto: port ChaCha20 to Zinc

2018-10-18 Thread Jason A. Donenfeld
Now that ChaCha20 is in Zinc, we can have the crypto API code simply call into it. The crypto API expects to have a stored key per instance and independent nonces, so we follow suite and store the key and initialize the nonce independently. Signed-off-by: Jason A. Donenfeld Cc: Samuel Neves Cc:

[PATCH net-next v8 24/28] zinc: Curve25519 ARM implementation

2018-10-18 Thread Jason A. Donenfeld
This ports the SUPERCOP implementation for usage in kernel space. In addition to the usual header, macro, and style changes required for kernel space, it makes a few small changes to the code: - The stack alignment is relaxed to 16 bytes. - Superfluous mov statements have been removed. - ldr

[PATCH net-next v8 16/28] zinc: import Andy Polyakov's Poly1305 MIPS64 implementation

2018-10-18 Thread Jason A. Donenfeld
This MIPS64 accelerated implementation comes from Andy Polyakov's implementation, and is included here in raw form without modification, so that subsequent commits that fix these up for the kernel can see how it has changed. While this is CRYPTOGAMS code, the originating code for this happens to b

[PATCH net-next v8 27/28] security/keys: rewrite big_key crypto to use Zinc

2018-10-18 Thread Jason A. Donenfeld
A while back, I noticed that the crypto and crypto API usage in big_keys were entirely broken in multiple ways, so I rewrote it. Now, I'm rewriting it again, but this time using Zinc's ChaCha20Poly1305 function. This makes the file considerably more simple; the diffstat alone should justify this co

[PATCH net-next v8 25/28] crypto: port Poly1305 to Zinc

2018-10-18 Thread Jason A. Donenfeld
Now that Poly1305 is in Zinc, we can have the crypto API code simply call into it. We have to do a little bit of book keeping here, because the crypto API receives the key in the first few calls to update. Signed-off-by: Jason A. Donenfeld Cc: Samuel Neves Cc: Andy Lutomirski Cc: Greg KH Cc: l

[PATCH net-next v8 22/28] zinc: Curve25519 x86_64 implementation

2018-10-18 Thread Jason A. Donenfeld
This implementation is the fastest available x86_64 implementation, and unlike Sandy2x, it doesn't requie use of the floating point registers at all. Instead it makes use of BMI2 and ADX, available on recent microarchitectures. The implementation was written by Armando Faz-Hernández with contributi

[PATCH net-next v8 23/28] zinc: import Bernstein and Schwabe's Curve25519 ARM implementation

2018-10-18 Thread Jason A. Donenfeld
This comes from Dan Bernstein and Peter Schwabe's public domain NEON code, and is included here in raw form so that subsequent commits that fix these up for the kernel can see how it has changed. This code does have some entirely cosmetic formatting differences, adding indentation and so forth, so

[PATCH net-next v8 21/28] zinc: Curve25519 generic C implementations and selftest

2018-10-18 Thread Jason A. Donenfeld
This contains two formally verified C implementations of the Curve25519 scalar multiplication function, one for 32-bit systems, and one for 64-bit systems whose compiler supports efficient 128-bit integer types. Not only are these implementations formally verified, but they are also the fastest ava

[PATCH net-next v8 17/28] zinc: Poly1305 MIPS32r2 and MIPS64 implementations

2018-10-18 Thread Jason A. Donenfeld
This MIPS32r2 implementation comes from René van Dorst and me and results in a nice speedup on the usual OpenWRT targets. The MIPS64 implementation from Andy Polyakov ported here results in a nice speedup on commodity Octeon hardware, and has been modified slightly from the original: - The functi

[PATCH net-next v8 06/28] zinc: ChaCha20 x86_64 implementation

2018-10-18 Thread Jason A. Donenfeld
This ports SSSE3, AVX-2, AVX-512F, and AVX-512VL implementations for ChaCha20. The AVX-512F implementation is disabled on Skylake, due to throttling, and the VL ymm implementation is used instead. These come from Andy Polyakov's implementation, with the following modifications from Samuel Neves:

[PATCH net-next v8 07/28] zinc: import Andy Polyakov's ChaCha20 ARM and ARM64 implementations

2018-10-18 Thread Jason A. Donenfeld
These NEON and non-NEON implementations come from Andy Polyakov's implementation, and are included here in raw form without modification, so that subsequent commits that fix these up for the kernel can see how it has changed. While this is CRYPTOGAMS code, the originating code for this happens to

[PATCH net-next v8 03/28] zinc: introduce minimal cryptography library

2018-10-18 Thread Jason A. Donenfeld
Zinc stands for "Zinc Is Neat Crypto" or "Zinc as IN Crypto". It's also short, easy to type, and plays nicely with the recent trend of naming crypto libraries after elements. The guiding principle is "don't overdo it". It's less of a library and more of a directory tree for organizing well-curated

[PATCH net-next v8 00/28] WireGuard: Secure Network Tunnel

2018-10-18 Thread Jason A. Donenfeld
Changes v7->v8, along with who suggested it. - Implementations that fail the selftests are now disabled, after a warning is printed. This way users don't make wrong calculations, even in the face of a rather grave bug. - [Sultan Alsawaf] When assigni

[PATCH net-next] cxgb4: fix the error path of cxgb4_uld_register()

2018-10-18 Thread Ganesh Goudar
On multi adapter setup if the uld registration fails even on one adapter, the allocated resources for the uld on all the adapters are freed, rendering the functioning adapters unusable. This commit fixes the issue by freeing the allocated resources only for the failed adapter. Signed-off-by: Gane

[PATCH] powerpc/8xx: Add DT node for using the SEC engine of the MPC885

2018-10-18 Thread Christophe Leroy
The MPC885 has SEC engine version 1.2 with the following details: - Number of Crypto channels: 1 - Exec Units: DEU, MDEU and AESU - Available descriptors: 00010, 00100, 00110, 01000, 11000, 11010 It is also supposed to have descriptor 0, but it doesn't work properly so we keep it out for the m

Re: [PATCH 0/3] crypto: ccree: add SM3 support

2018-10-18 Thread Gilad Ben-Yossef
On Thu, Oct 18, 2018 at 4:00 PM Yael Chemla wrote: > > Add support for SM3 in CryptoCell 713. > > Yael Chemla (3): > crypto: ccree: adjust hash length to suit certain context specifics > crypto: ccree: modify set_cipher_mode usage from cc_hash > crypto: ccree: add SM3 support > > drivers/c

[PATCH 1/3] crypto: ccree: adjust hash length to suit certain context specifics

2018-10-18 Thread Yael Chemla
Adjust hash length such that it will not be fixed and general for all algs. Instead make it suitable for certain context information. This is preparation for SM3 support. Signed-off-by: Yael Chemla --- drivers/crypto/ccree/cc_aead.c | 19 ++- drivers/crypto/ccree/cc_driver.c |

[PATCH 2/3] crypto: ccree: modify set_cipher_mode usage from cc_hash

2018-10-18 Thread Yael Chemla
encapsulate set_cipher_mode call with another api, preparation for specific hash behavior as needed in later patches when SM3 introduced. Signed-off-by: Yael Chemla --- drivers/crypto/ccree/cc_hash.c | 18 +- drivers/crypto/ccree/cc_hw_queue_defs.h | 14 ++ 2

[PATCH 3/3] crypto: ccree: add SM3 support

2018-10-18 Thread Yael Chemla
Add support for SM3 cipher in CryptoCell 713. Signed-off-by: Yael Chemla --- drivers/crypto/Kconfig | 1 + drivers/crypto/ccree/cc_crypto_ctx.h| 4 +- drivers/crypto/ccree/cc_hash.c | 119 ++-- drivers/crypto/ccree/cc_hw_queue_defs.h

[PATCH 0/3] crypto: ccree: add SM3 support

2018-10-18 Thread Yael Chemla
Add support for SM3 in CryptoCell 713. Yael Chemla (3): crypto: ccree: adjust hash length to suit certain context specifics crypto: ccree: modify set_cipher_mode usage from cc_hash crypto: ccree: add SM3 support drivers/crypto/Kconfig | 1 + drivers/crypto/ccree/cc_aead

Re: [PATCH 3/3] crypto: qce: ice: Add support for Inline Crypto Engine

2018-10-18 Thread kbuild test robot
Hi AnilKumar, Thank you for the patch! Yet something to improve: [auto build test ERROR on cryptodev/master] [also build test ERROR on v4.19-rc8 next-20181018] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci