Re: [PATCH v2 2/2] kbuild: trace functions in subdirectories of lib/

2020-07-07 Thread Petr Mladek
On Tue 2020-07-07 18:21:17, Masahiro Yamada wrote: > ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE) > > exists here in sub-directories of lib/ to keep the behavior of > commit 2464a609ded0 ("ftrace: do not trace library functions"). > > Since that commit, not only the objects in

Re: [v3 PATCH] crypto: chacha - Add DEFINE_CHACHA_STATE macro

2020-07-07 Thread Ard Biesheuvel
On Wed, 8 Jul 2020 at 08:46, Ard Biesheuvel wrote: > > On Wed, 8 Jul 2020 at 05:44, Herbert Xu wrote: > > > > On Tue, Jul 07, 2020 at 07:31:08PM -0700, Eric Biggers wrote: > > > > > > Hmm, __chacha20poly1305_encrypt() already uses: > > > > > > memzero_explicit(chacha_state, CHACHA_STATE_WOR

Re: [PATCH 0/4] crypto: add sha256() function

2020-07-07 Thread Ard Biesheuvel
On Tue, 7 Jul 2020 at 21:59, Eric Biggers wrote: > > This series adds a function sha256() to the sha256 library so that users > who want to compute a hash in one step can just call sha256() instead of > sha256_init() + sha256_update() + sha256_final(). > > Patches 2-4 then convert some users to us

Re: [v3 PATCH] crypto: chacha - Add DEFINE_CHACHA_STATE macro

2020-07-07 Thread Ard Biesheuvel
On Wed, 8 Jul 2020 at 05:44, Herbert Xu wrote: > > On Tue, Jul 07, 2020 at 07:31:08PM -0700, Eric Biggers wrote: > > > > Hmm, __chacha20poly1305_encrypt() already uses: > > > > memzero_explicit(chacha_state, CHACHA_STATE_WORDS * sizeof(u32)); > > > > That's equivalent to CHACHA_BLOCK_SIZE no

[v3 PATCH] crypto: chacha - Add DEFINE_CHACHA_STATE macro

2020-07-07 Thread Herbert Xu
On Tue, Jul 07, 2020 at 07:31:08PM -0700, Eric Biggers wrote: > > Hmm, __chacha20poly1305_encrypt() already uses: > > memzero_explicit(chacha_state, CHACHA_STATE_WORDS * sizeof(u32)); > > That's equivalent to CHACHA_BLOCK_SIZE now, but it would be best to use the > same > constant everywh

[PATCH] crypto: lib/chacha20poly1305 - Add missing function declaration

2020-07-07 Thread Herbert Xu
This patch adds a declaration for chacha20poly1305_selftest to silence a sparse warning. Signed-off-by: Herbert Xu diff --git a/include/crypto/chacha20poly1305.h b/include/crypto/chacha20poly1305.h index 234ee28078efd..d2ac3ff7dc1ec 100644 --- a/include/crypto/chacha20poly1305.h +++ b/include/c

Re: [v2 PATCH] crypto: chacha - Add DEFINE_CHACHA_STATE macro

2020-07-07 Thread Eric Biggers
On Tue, Jul 07, 2020 at 08:37:16AM +1000, Herbert Xu wrote: > On Mon, Jul 06, 2020 at 12:07:17PM -0700, Eric Biggers wrote: > > > > This changes chacha_state to be a pointer, which breaks clearing the state > > because that uses sizeof(chacha_state): > > > > memzero_explicit(chacha_state, size

Re: [PATCH v2 1/2] kbuild: introduce ccflags-remove-y and asflags-remove-y

2020-07-07 Thread Anders Roxell
On Tue, 7 Jul 2020 at 11:21, Masahiro Yamada wrote: > > CFLAGS_REMOVE_.o filters out flags when compiling a particular > object, but there is no convenient way to do that for every object in > a directory. > > Add ccflags-remove-y and asflags-remove-y to make it easily. > > Use ccflags-remove-y to

Re: [PATCH v4 07/13] crypto: ccp - permit asynchronous skcipher as fallback

2020-07-07 Thread John Allen
On Tue, Jul 07, 2020 at 09:31:57AM +0300, Ard Biesheuvel wrote: > Even though the ccp driver implements an asynchronous version of xts(aes), > the fallback it allocates is required to be synchronous. Given that SIMD > based software implementations are usually asynchronous as well, even > though th

Re: [PATCH] crypto: ccp - Fix sparse warnings

2020-07-07 Thread John Allen
On Fri, Jul 03, 2020 at 02:46:52PM +1000, Herbert Xu wrote: > This patch fixes a number of endianness marking issues in the ccp > driver. > > Signed-off-by: Herbert Xu Acked-by: John Allen

[PATCH 1/4] crypto: lib/sha256 - add sha256() function

2020-07-07 Thread Eric Biggers
From: Eric Biggers Add a function sha256() which computes a SHA-256 digest in one step, combining sha256_init() + sha256_update() + sha256_final(). This is similar to how we also have blake2s(). Signed-off-by: Eric Biggers --- include/crypto/sha.h | 1 + lib/crypto/sha256.c | 10 ++

[PATCH 4/4] ASoC: cros_ec_codec: use sha256() instead of open coding

2020-07-07 Thread Eric Biggers
From: Eric Biggers Now that there's a function that calculates the SHA-256 digest of a buffer in one step, use it instead of sha256_init() + sha256_update() + sha256_final(). Also simplify the code by inlining calculate_sha256() into its caller and switching a debug log statement to use %*phN in

[PATCH 0/4] crypto: add sha256() function

2020-07-07 Thread Eric Biggers
This series adds a function sha256() to the sha256 library so that users who want to compute a hash in one step can just call sha256() instead of sha256_init() + sha256_update() + sha256_final(). Patches 2-4 then convert some users to use it. Eric Biggers (4): crypto: lib/sha256 - add sha256()

[PATCH 2/4] efi: use sha256() instead of open coding

2020-07-07 Thread Eric Biggers
From: Eric Biggers Now that there's a function that calculates the SHA-256 digest of a buffer in one step, use it instead of sha256_init() + sha256_update() + sha256_final(). Cc: linux-...@vger.kernel.org Cc: Ard Biesheuvel Cc: Hans de Goede Signed-off-by: Eric Biggers --- drivers/firmware/e

[PATCH 3/4] mptcp: use sha256() instead of open coding

2020-07-07 Thread Eric Biggers
From: Eric Biggers Now that there's a function that calculates the SHA-256 digest of a buffer in one step, use it instead of sha256_init() + sha256_update() + sha256_final(). Cc: mp...@lists.01.org Cc: Mat Martineau Cc: Matthieu Baerts Signed-off-by: Eric Biggers --- net/mptcp/crypto.c | 15

Re: [PATCH v2 2/2] kbuild: trace functions in subdirectories of lib/

2020-07-07 Thread Steven Rostedt
On Tue, 7 Jul 2020 18:21:17 +0900 Masahiro Yamada wrote: > ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE) > > exists here in sub-directories of lib/ to keep the behavior of > commit 2464a609ded0 ("ftrace: do not trace library functions"). > > Since that commit, not only the o

Re: [PATCH 0/6] crypto: add CRYPTO_ALG_ALLOCATES_MEMORY

2020-07-07 Thread Mikulas Patocka
On Mon, 6 Jul 2020, Eric Biggers wrote: > On Wed, Jul 01, 2020 at 03:59:10AM -0400, Mikulas Patocka wrote: > > Thanks for cleaning this up. > > > > Mikulas > > Do you have any real comments on this? > > Are the usage restrictions okay for dm-crypt? > > - Eric I think that your patch series

[PATCH v4] mm/zswap: move to use crypto_acomp API for hardware acceleration

2020-07-07 Thread Barry Song
right now, all new ZIP drivers are using crypto_acomp APIs rather than legacy crypto_comp APIs. But zswap.c is still using the old APIs. That means zswap won't be able to use any new zip drivers in kernel. This patch moves to use cryto_acomp APIs to fix the problem. On the other hand, tradiontal c

[PATCH v2 1/2] kbuild: introduce ccflags-remove-y and asflags-remove-y

2020-07-07 Thread Masahiro Yamada
CFLAGS_REMOVE_.o filters out flags when compiling a particular object, but there is no convenient way to do that for every object in a directory. Add ccflags-remove-y and asflags-remove-y to make it easily. Use ccflags-remove-y to clean up some Makefiles. The add/remove order works as follows:

[PATCH v2 2/2] kbuild: trace functions in subdirectories of lib/

2020-07-07 Thread Masahiro Yamada
ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE) exists here in sub-directories of lib/ to keep the behavior of commit 2464a609ded0 ("ftrace: do not trace library functions"). Since that commit, not only the objects in lib/ but also the ones in the sub-directories are excluded fro

Re: [PATCH 1/1] crypto: ux500: hash: Add namespacing to hash_init()

2020-07-07 Thread Lee Jones
On Tue, 30 Jun 2020, Lee Jones wrote: > On Tue, 30 Jun 2020, Herbert Xu wrote: > > On Mon, Jun 29, 2020 at 01:30:03PM +0100, Lee Jones wrote: > > > A recent change to the Regulator consumer API (which this driver > > > utilises) add prototypes for the some suspend functions. These > > > functions