Re: [PATCH] crypto: testmgr - add some more preemption points

2019-06-02 Thread Ard Biesheuvel
On Mon, 3 Jun 2019 at 07:42, Eric Biggers wrote: > > From: Eric Biggers > > Call cond_resched() after each fuzz test iteration. This avoids stall > warnings if fuzz_iterations is set very high for testing purposes. > > While we're at it, also call cond_resched() after finishing testing each > te

Re: [PATCH 0/2] crypto: make cra_driver_name mandatory

2019-06-02 Thread Ard Biesheuvel
On Mon, 3 Jun 2019 at 07:41, Eric Biggers wrote: > > Most generic crypto algorithms declare a driver name ending in > "-generic". The rest don't declare a driver name and instead rely on > the crypto API automagically appending "-generic" upon registration. > > Having multiple conventions is unne

Re: [PATCH] crypto: doc - improve the skcipher API example code

2019-06-02 Thread Ard Biesheuvel
On Mon, 3 Jun 2019 at 07:44, Eric Biggers wrote: > > From: Eric Biggers > > Rewrite the skcipher API example, changing it to encrypt a buffer with > AES-256-XTS. This addresses various problems with the previous example: > > - It requests a specific driver "cbc-aes-aesni", which is unusual. >

Re: [PATCH] crypto: x86/aesni - remove unused internal cipher algorithm

2019-06-02 Thread Ard Biesheuvel
On Mon, 3 Jun 2019 at 07:45, Eric Biggers wrote: > > From: Eric Biggers > > Since commit 944585a64f5e ("crypto: x86/aes-ni - remove special handling > of AES in PCBC mode"), the "__aes-aesni" internal cipher algorithm is no > longer used. So remove it too. > > Signed-off-by: Eric Biggers Acked

Re: [PATCH] crypto: aead - un-inline encrypt and decrypt functions

2019-06-02 Thread Ard Biesheuvel
On Mon, 3 Jun 2019 at 07:45, Eric Biggers wrote: > > From: Eric Biggers > > crypto_aead_encrypt() and crypto_aead_decrypt() have grown to be more > than a single indirect function call. They now also check whether a key > has been set, the decryption side checks whether the input is at least > a

Re: [PATCH] crypto: skcipher - un-inline encrypt and decrypt functions

2019-06-02 Thread Ard Biesheuvel
On Mon, 3 Jun 2019 at 07:46, Eric Biggers wrote: > > From: Eric Biggers > > crypto_skcipher_encrypt() and crypto_skcipher_decrypt() have grown to be > more than a single indirect function call. They now also check whether > a key has been set, and with CONFIG_CRYPTO_STATS=y they also update the

Re: [PATCH] crypto: chacha - constify ctx and iv arguments

2019-06-02 Thread Ard Biesheuvel
On Mon, 3 Jun 2019 at 07:47, Eric Biggers wrote: > > From: Eric Biggers > > Constify the ctx and iv arguments to crypto_chacha_init() and the > various chacha*_stream_xor() functions. This makes it clear that they > are not modified. > > Signed-off-by: Eric Biggers Acked-by: Ard Biesheuvel >

Re: [PATCH] crypto: skcipher - make chunksize and walksize accessors internal

2019-06-02 Thread Ard Biesheuvel
On Mon, 3 Jun 2019 at 07:46, Eric Biggers wrote: > > From: Eric Biggers > > The 'chunksize' and 'walksize' properties of skcipher algorithms are > implementation details that users of the skcipher API should not be > looking at. So move their accessor functions from > to . > > Signed-off-by: Er

[PATCH] crypto: chacha20poly1305 - a few cleanups

2019-06-02 Thread Eric Biggers
From: Eric Biggers - Use sg_init_one() instead of sg_init_table() then sg_set_buf(). - Remove unneeded calls to sg_init_table() prior to scatterwalk_ffwd(). - Simplify initializing the poly tail block. - Simplify computing padlen. This doesn't change any actual behavior. Cc: Martin Willi Si

[PATCH] crypto: chacha - constify ctx and iv arguments

2019-06-02 Thread Eric Biggers
From: Eric Biggers Constify the ctx and iv arguments to crypto_chacha_init() and the various chacha*_stream_xor() functions. This makes it clear that they are not modified. Signed-off-by: Eric Biggers --- arch/arm/crypto/chacha-neon-glue.c | 2 +- arch/arm64/crypto/chacha-neon-glue.c | 2 +-

[PATCH] crypto: skcipher - un-inline encrypt and decrypt functions

2019-06-02 Thread Eric Biggers
From: Eric Biggers crypto_skcipher_encrypt() and crypto_skcipher_decrypt() have grown to be more than a single indirect function call. They now also check whether a key has been set, and with CONFIG_CRYPTO_STATS=y they also update the crypto statistics. That can add up to a lot of bloat at ever

[PATCH] crypto: skcipher - make chunksize and walksize accessors internal

2019-06-02 Thread Eric Biggers
From: Eric Biggers The 'chunksize' and 'walksize' properties of skcipher algorithms are implementation details that users of the skcipher API should not be looking at. So move their accessor functions from to . Signed-off-by: Eric Biggers --- include/crypto/internal/skcipher.h | 60 +

[PATCH] crypto: x86/aesni - remove unused internal cipher algorithm

2019-06-02 Thread Eric Biggers
From: Eric Biggers Since commit 944585a64f5e ("crypto: x86/aes-ni - remove special handling of AES in PCBC mode"), the "__aes-aesni" internal cipher algorithm is no longer used. So remove it too. Signed-off-by: Eric Biggers --- arch/x86/crypto/aesni-intel_glue.c | 45 +

[PATCH] crypto: aead - un-inline encrypt and decrypt functions

2019-06-02 Thread Eric Biggers
From: Eric Biggers crypto_aead_encrypt() and crypto_aead_decrypt() have grown to be more than a single indirect function call. They now also check whether a key has been set, the decryption side checks whether the input is at least as long as the authentication tag length, and with CONFIG_CRYPTO

[PATCH] crypto: doc - improve the skcipher API example code

2019-06-02 Thread Eric Biggers
From: Eric Biggers Rewrite the skcipher API example, changing it to encrypt a buffer with AES-256-XTS. This addresses various problems with the previous example: - It requests a specific driver "cbc-aes-aesni", which is unusual. Normally users ask for "cbc(aes)", not a specific driver. - It

[PATCH] crypto: testmgr - add some more preemption points

2019-06-02 Thread Eric Biggers
From: Eric Biggers Call cond_resched() after each fuzz test iteration. This avoids stall warnings if fuzz_iterations is set very high for testing purposes. While we're at it, also call cond_resched() after finishing testing each test vector. Signed-off-by: Eric Biggers --- crypto/testmgr.c |

[PATCH 0/2] crypto: make cra_driver_name mandatory

2019-06-02 Thread Eric Biggers
Most generic crypto algorithms declare a driver name ending in "-generic". The rest don't declare a driver name and instead rely on the crypto API automagically appending "-generic" upon registration. Having multiple conventions is unnecessarily confusing and makes it harder to grep for all gener

[PATCH 2/2] crypto: algapi - require cra_name and cra_driver_name

2019-06-02 Thread Eric Biggers
From: Eric Biggers Now that all algorithms explicitly set cra_driver_name, make it required for algorithm registration and remove the code that generated a default cra_driver_name. Also add an explicit check that cra_name is set too, since that's obviously required too, yet it didn't seem to be

[PATCH 1/2] crypto: make all generic algorithms set cra_driver_name

2019-06-02 Thread Eric Biggers
From: Eric Biggers Most generic crypto algorithms declare a driver name ending in "-generic". The rest don't declare a driver name and instead rely on the crypto API automagically appending "-generic" upon registration. Having multiple conventions is unnecessarily confusing and makes it harder

Re: [PATCH v2 1/3] soc: mediatek: add SMC fid table for SIP interface

2019-06-02 Thread Neal Liu
Hi Sean, On Fri, 2019-05-31 at 06:50 +0800, Sean Wang wrote: > Hi Neal, > > On Mon, May 27, 2019 at 1:39 AM Neal Liu wrote: > > > > 1. Add a header file to provide SIP interface to ARM Trusted > > Firmware(ATF) > > 2. Add hwrng SMC fid > > > > Signed-off-by: Neal Liu > > --- > > include/linux

Re: [PATCH v2 3/3] hwrng: add mtk-sec-rng driver

2019-06-02 Thread Neal Liu
Hi Sean, On Thu, 2019-05-30 at 15:59 -0700, Sean Wang wrote: > Hi, Neal > > On Mon, May 27, 2019 at 1:39 AM Neal Liu wrote: > > > > For MediaTek SoCs on ARMv8 with TrustZone enabled, peripherals like > > entropy sources is not accessible from normal world (linux) and > > rather accessible from s

Re: [PATCH v2 2/3] dt-bindings: rng: update bindings for MediaTek ARMv8 SoCs

2019-06-02 Thread Neal Liu
Hi Sean, On Thu, 2019-05-30 at 15:56 -0700, Sean Wang wrote: > Hi, Neal > > On Mon, May 27, 2019 at 1:39 AM Neal Liu wrote: > > > > Document the binding used by the MediaTek ARMv8 SoCs random > > number generator with TrustZone enabled. > > > > Signed-off-by: Neal Liu > > --- > > Documentatio