linux-stable/arch/x86
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
..
boot EFI updates collected by Ard Biesheuvel: 2020-12-24 12:40:07 -08:00
configs * A defconfig fix, from Daniel Díaz. 2020-09-20 15:06:43 -07:00
crypto crypto: blake2s - share the "shash" API boilerplate code 2021-01-03 08:41:38 +11:00
entry epoll: wire up syscall epoll_pwait2 2020-12-19 11:18:38 -08:00
events Perf updates: 2020-12-14 17:34:12 -08:00
hyperv hyperv-fixes for 5.10-rc3 2020-11-05 11:32:03 -08:00
ia32 x86/ia32_signal: Propagate __user annotation properly 2020-12-11 19:44:31 +01:00
include EFI updates collected by Ard Biesheuvel: 2020-12-24 12:40:07 -08:00
kernel A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
kvm ARM: 2020-12-20 10:44:05 -08:00
lib Scheduler updates: 2020-12-14 18:29:11 -08:00
math-emu
mm Merge branch 'stable/for-linus-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2020-12-16 13:51:34 -08:00
net bpf: x64: Do not emit sub/add 0, %rsp when !stack_depth 2020-09-29 16:47:39 -07:00
oprofile x86/oprofile: Avoid TIF_IA32 when checking 64bit mode 2020-10-26 13:46:46 +01:00
pci ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
platform Yet another large set of x86 interrupt management updates: 2020-12-14 18:59:53 -08:00
power
purgatory crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
ras
realmode
tools
um arch/um: partially revert the conversion to __section() macro 2020-10-26 15:39:37 -07:00
video
xen EFI updates collected by Ard Biesheuvel: 2020-12-24 12:40:07 -08:00
.gitignore
Kbuild
Kconfig Tracing updates for 5.11 2020-12-17 13:22:17 -08:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug x86, libnvdimm/test: Remove COPY_MC_TEST 2020-10-26 18:08:35 +01:00
Makefile - Fix the vmlinux size check on 64-bit along with adding useful clarifications on the topic 2020-12-14 13:54:50 -08:00
Makefile.um
Makefile_32.cpu