[PATCH v2] crypto: arm64/gcm - move authentication tag check to SIMD domain

2020-11-10 Thread Ard Biesheuvel
Instead of copying the calculated authentication tag to memory and calling crypto_memneq() to verify it, use vector bytewise compare and min across vector instructions to decide whether the tag is valid. This is more efficient, and given that the tag is only transiently held in a NEON register, it

Re: jitterentropy: `jent_mod_init()` takes 17 ms

2020-11-10 Thread Stephan Mueller
Am Montag, 9. November 2020, 20:31:02 CET schrieb Paul Menzel: Hi Paul, > Dear Linux folks, > > > By mistake I built `XFRM_ESP` into the Linux kernel, resulting in > > CONFIG_CRYPTO_SEQIV=y > CONFIG_CRYPTO_ECHAINIV=y > > and also the Jitterentropy RNG to be built in. > > CRYPT

Re: jitterentropy: `jent_mod_init()` takes 17 ms

2020-11-10 Thread Paul Menzel
Dear Stephan, Thank you for the quick reply. Am 10.11.20 um 10:25 schrieb Stephan Mueller: Am Montag, 9. November 2020, 20:31:02 CET schrieb Paul Menzel: By mistake I built `XFRM_ESP` into the Linux kernel, resulting in CONFIG_CRYPTO_SEQIV=y CONFIG_CRYPTO_ECHAINIV=y and also t

Re: jitterentropy: `jent_mod_init()` takes 17 ms

2020-11-10 Thread Stephan Mueller
Am Dienstag, 10. November 2020, 10:37:02 CET schrieb Paul Menzel: Hi Paul, > Dear Stephan, > > > Thank you for the quick reply. > > Am 10.11.20 um 10:25 schrieb Stephan Mueller: > > Am Montag, 9. November 2020, 20:31:02 CET schrieb Paul Menzel: > >> By mistake I built `XFRM_ESP` into the Linux

Re: [PATCH v36 00/13] /dev/random - a new approach

2020-11-10 Thread Stephan Mueller
Am Montag, 19. Oktober 2020, 21:28:50 CET schrieb Stephan Müller: Hi, > > * Performance > > - Faster by up to 75% in the critical code path of the interrupt handler >depending on data collection size configurable at kernel compile time - >the default is about equal in performance with e

Re: [PATCH 0/1] arm64: Accelerate Adler32 using arm64 SVE instructions.

2020-11-10 Thread Dave Martin
On Mon, Nov 09, 2020 at 11:43:35AM +0800, Li Qiang wrote: > Hi Dave, > > I carefully read the ideas you provided and the sample code you gave me.:) > > 在 2020/11/6 0:53, Dave Martin 写道: > > On Tue, Nov 03, 2020 at 08:15:05PM +0800, l00374334 wrote: > >> From: liqiang > >> > >> Dear all, > >> > >

Re: Subject: [RFC] clang tooling cleanups

2020-11-10 Thread Tom Rix
On 11/9/20 6:52 PM, Joe Perches wrote: > On Tue, 2020-10-27 at 09:42 -0700, t...@redhat.com wrote: >> This rfc will describe >> An upcoming treewide cleanup. >> How clang tooling was used to programatically do the clean up. >> Solicit opinions on how to generally use clang tooling. >> >> The clan

Re: [PATCH 0/1] arm64: Accelerate Adler32 using arm64 SVE instructions.

2020-11-10 Thread Li Qiang
在 2020/11/10 18:46, Dave Martin 写道: > On Mon, Nov 09, 2020 at 11:43:35AM +0800, Li Qiang wrote: >> Hi Dave, >> >> I carefully read the ideas you provided and the sample code you gave me.:) >> >> 在 2020/11/6 0:53, Dave Martin 写道: >>> On Tue, Nov 03, 2020 at 08:15:05PM +0800, l00374334 wrote:

Re: [PATCH v5 1/9] lib: zstd: Add zstd compatibility wrapper

2020-11-10 Thread David Sterba
On Mon, Nov 09, 2020 at 02:01:41PM -0500, Chris Mason wrote: > On 6 Nov 2020, at 13:38, Christoph Hellwig wrote: > > You just keep resedning this crap, don't you? Haven't you been told > > multiple times to provide a proper kernel API by now? > > You do consistently ask for a shim layer, but you

Re: [PATCH 0/1] arm64: Accelerate Adler32 using arm64 SVE instructions.

2020-11-10 Thread Dave Martin
On Tue, Nov 10, 2020 at 09:20:46PM +0800, Li Qiang wrote: > > > 在 2020/11/10 18:46, Dave Martin 写道: > > On Mon, Nov 09, 2020 at 11:43:35AM +0800, Li Qiang wrote: > >> Hi Dave, > >> > >> I carefully read the ideas you provided and the sample code you gave me.:) > >> > >> 在 2020/11/6 0:53, Dave Mar

Re: [PATCH v2 1/3] dt-bindings: crypto: Add Keem Bay OCS HCU bindings

2020-11-10 Thread Daniele Alessandrelli
On Mon, 2020-11-09 at 10:15 -0600, Rob Herring wrote: > On Tue, Nov 03, 2020 at 06:49:23PM +, Daniele Alessandrelli wrote: > > From: Declan Murphy > > > > Add device-tree bindings for the Intel Keem Bay Offload Crypto Subsystem > > (OCS) Hashing Control Unit (HCU) crypto driver. > > > > Sign

Re: [PATCH v5 1/9] lib: zstd: Add zstd compatibility wrapper

2020-11-10 Thread Christoph Hellwig
On Mon, Nov 09, 2020 at 02:01:41PM -0500, Chris Mason wrote: > You do consistently ask for a shim layer, but you haven???t explained what > we gain by diverging from the documented and tested API of the upstream zstd > project. It???s an important discussion given that we hope to regularly > updat

[PATCH v2 0/4] crypto: aegis128 enhancements

2020-11-10 Thread Ard Biesheuvel
This series supersedes [0] '[PATCH] crypto: aegis128/neon - optimize tail block handling', which is included as patch #3 here, but hasn't been modified substantially. Patch #1 should probably go to -stable, even though aegis128 does not appear to be widely used. Patches #2 and #3 improve the SIMD

[PATCH v2 4/4] crypto: aegis128 - expose SIMD code path as separate driver

2020-11-10 Thread Ard Biesheuvel
Wiring the SIMD code into the generic driver has the unfortunate side effect that the tcrypt testing code cannot distinguish them, and will therefore not use the latter to fuzz test the former, as it does for other algorithms. So let's refactor the code a bit so we can register two implementations

[PATCH v2 2/4] crypto: aegis128/neon - optimize tail block handling

2020-11-10 Thread Ard Biesheuvel
Avoid copying the tail block via a stack buffer if the total size exceeds a single AEGIS block. In this case, we can use overlapping loads and stores and NEON permutation instructions instead, which leads to a modest performance improvement on some cores (< 5%), and is slightly cleaner. Note that w

[PATCH v2 1/4] crypto: aegis128 - wipe plaintext and tag if decryption fails

2020-11-10 Thread Ard Biesheuvel
The AEGIS spec mentions explicitly that the security guarantees hold only if the resulting plaintext and tag of a failed decryption are not disclosed. So ensure that we abide by this. While at it, drop the unused struct aead_request *req parameter from crypto_aegis128_process_crypt(). Signed-off-

[PATCH v2 3/4] crypto: aegis128/neon - move final tag check to SIMD domain

2020-11-10 Thread Ard Biesheuvel
Instead of calculating the tag and returning it to the caller on decryption, use a SIMD compare and min across vector to perform the comparison. This is slightly more efficient, and removes the need on the caller's part to wipe the tag from memory if the decryption failed. While at it, switch to u

Re: [PATCH v5 1/9] lib: zstd: Add zstd compatibility wrapper

2020-11-10 Thread Chris Mason
On 10 Nov 2020, at 13:39, Christoph Hellwig wrote: On Mon, Nov 09, 2020 at 02:01:41PM -0500, Chris Mason wrote: You do consistently ask for a shim layer, but you haven???t explained what we gain by diverging from the documented and tested API of the upstream zstd project. It???s an important

Re: [PATCH v5 1/9] lib: zstd: Add zstd compatibility wrapper

2020-11-10 Thread Nick Terrell
> On Nov 10, 2020, at 7:25 AM, David Sterba wrote: > > On Mon, Nov 09, 2020 at 02:01:41PM -0500, Chris Mason wrote: >> On 6 Nov 2020, at 13:38, Christoph Hellwig wrote: >>> You just keep resedning this crap, don't you? Haven't you been told >>> multiple times to provide a proper kernel API by no

Re: [PATCH v5 1/9] lib: zstd: Add zstd compatibility wrapper

2020-11-10 Thread Nick Terrell
> On Nov 10, 2020, at 10:39 AM, Christoph Hellwig wrote: > > On Mon, Nov 09, 2020 at 02:01:41PM -0500, Chris Mason wrote: >> You do consistently ask for a shim layer, but you haven???t explained what >> we gain by diverging from the documented and tested API of the upstream zstd >> project. It

Re: [PATCH -next] treewide: Remove stringification from __alias macro definition

2020-11-10 Thread Ard Biesheuvel
(+ Russell) On Thu, 22 Oct 2020 at 18:20, Joe Perches wrote: > > On Thu, 2020-10-22 at 09:33 +0200, Peter Zijlstra wrote: > > On Wed, Oct 21, 2020 at 11:58:25AM -0700, Joe Perches wrote: > > > Like the __section macro, the __alias macro uses > > > macro # stringification to create quotes around >