linux-stable/arch
Eric Biggers 8c4a93a127 crypto: blake2s - share the "shash" API boilerplate code
Add helper functions for shash implementations of BLAKE2s to
include/crypto/internal/blake2s.h, taking advantage of
__blake2s_update() and __blake2s_final() that were added by the previous
patch to share more code between the library and shash implementations.

crypto_blake2s_setkey() and crypto_blake2s_init() are usable as
shash_alg::setkey and shash_alg::init directly, while
crypto_blake2s_update() and crypto_blake2s_final() take an extra
'blake2s_compress_t' function pointer parameter.  This allows the
implementation of the compression function to be overridden, which is
the only part that optimized implementations really care about.

The new functions are inline functions (similar to those in sha1_base.h,
sha256_base.h, and sm3_base.h) because this avoids needing to add a new
module blake2s_helpers.ko, they aren't *too* long, and this avoids
indirect calls which are expensive these days.  Note that they can't go
in blake2s_generic.ko, as that would require selecting CRYPTO_BLAKE2S
from CRYPTO_BLAKE2S_X86, which would cause a recursive dependency.

Finally, use these new helper functions in the x86 implementation of
BLAKE2s.  (This part should be a separate patch, but unfortunately the
x86 implementation used the exact same function names like
"crypto_blake2s_update()", so it had to be updated at the same time.)

Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2021-01-03 08:41:38 +11:00
..
alpha A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
arc tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
arm crypto: remove cipher routines from public crypto API 2021-01-03 08:41:35 +11:00
arm64 crypto: arm64/aes-ctr - improve tail handling 2021-01-03 08:41:37 +11:00
c6x tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
csky Tracing updates for 5.11 2020-12-17 13:22:17 -08:00
h8300 tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
hexagon tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
ia64 Kbuild updates for v5.11 2020-12-22 14:02:39 -08:00
m68k Fixes include: 2020-12-21 10:35:11 -08:00
microblaze epoll: wire up syscall epoll_pwait2 2020-12-19 11:18:38 -08:00
mips epoll: fix compat syscall wire up of epoll_pwait2 2020-12-20 10:01:38 -08:00
nds32 Tracing updates for 5.11 2020-12-17 13:22:17 -08:00
nios2 tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
openrisc OpenRISC updates for 5.11 2020-12-17 13:41:27 -08:00
parisc A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
powerpc powerpc fixes for 5.11 #2 2020-12-24 14:02:00 -08:00
riscv RISC-V Fixes for 5.11-rc1 2020-12-24 14:05:05 -08:00
s390 crypto: remove cipher routines from public crypto API 2021-01-03 08:41:35 +11:00
sh The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
sparc epoll: fix compat syscall wire up of epoll_pwait2 2020-12-20 10:01:38 -08:00
um This pull request contains the following changes for UML: 2020-12-17 17:56:44 -08:00
x86 crypto: blake2s - share the "shash" API boilerplate code 2021-01-03 08:41:38 +11:00
xtensa The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
.gitignore
Kconfig kasan: allow VMAP_STACK for HW_TAGS mode 2020-12-22 12:55:08 -08:00