android_kernel_motorola_sm6375/arch
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Eric Biggers be7d8de428 UPSTREAM: crypto: arm/blake2s - add ARM scalar optimized BLAKE2s
Add an ARM scalar optimized implementation of BLAKE2s.

NEON isn't very useful for BLAKE2s because the BLAKE2s block size is too
small for NEON to help.  Each NEON instruction would depend on the
previous one, resulting in poor performance.

With scalar instructions, on the other hand, we can take advantage of
ARM's "free" rotations (like I did in chacha-scalar-core.S) to get an
implementation get runs much faster than the C implementation.

Performance results on Cortex-A7 in cycles per byte using the shash API:

	4096-byte messages:
		blake2s-256-arm:     18.8
		blake2s-256-generic: 26.0

	500-byte messages:
		blake2s-256-arm:     20.3
		blake2s-256-generic: 27.9

	100-byte messages:
		blake2s-256-arm:     29.7
		blake2s-256-generic: 39.2

	32-byte messages:
		blake2s-256-arm:     50.6
		blake2s-256-generic: 66.2

Except on very short messages, this is still slower than the NEON
implementation of BLAKE2b which I've written; that is 14.0, 16.4, 25.8,
and 76.1 cpb on 4096, 500, 100, and 32-byte messages, respectively.
However, optimized BLAKE2s is useful for cases where BLAKE2s is used
instead of BLAKE2b, such as WireGuard.

This new implementation is added in the form of a new module
blake2s-arm.ko, which is analogous to blake2s-x86_64.ko in that it
provides blake2s_compress_arch() for use by the library API as well as
optionally register the algorithms with the shash API.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Tested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

(cherry picked from commit 5172d322d34c30fb926b29aeb5a064e1fd8a5e13)
Bug: 152722841
Bug: 178411248
Change-Id: I0ba7a0ea53518d512ccbe54a56970d6bbe2a32e0
Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-10-23 19:32:26 -07:00
..
alpha alpha: Send stop IPI to send to online CPUs 2021-08-12 13:21:05 +02:00
arc This is the 5.4.145 stable release 2021-09-12 09:54:40 +02:00
arm UPSTREAM: crypto: arm/blake2s - add ARM scalar optimized BLAKE2s 2021-10-23 19:32:26 -07:00
arm64 This is the 5.4.146 stable release 2021-09-15 14:01:16 +02:00
c6x
csky
h8300
hexagon hexagon: use common DISCARDS macro 2021-07-20 16:10:50 +02:00
ia64 ia64: mca_drv: fix incorrect array size calculation 2021-07-14 16:53:19 +02:00
m68k m68k: emu: Fix invalid free in nfeth_cleanup() 2021-09-15 09:47:28 +02:00
microblaze
mips This is the 5.4.146 stable release 2021-09-15 14:01:16 +02:00
nds32 nds32: fix up stack guard gap 2021-07-28 13:31:01 +02:00
nios2
openrisc
parisc Revert "parisc: Add assembly implementations for memset, strlen, strcpy, strncpy and strcat" 2021-09-03 10:08:16 +02:00
powerpc This is the 5.4.146 stable release 2021-09-15 14:01:16 +02:00
riscv bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-15 09:47:38 +02:00
s390 KVM: s390: index kvm->arch.idle_mask by vcpu_idx 2021-09-15 09:47:40 +02:00
sh
sparc bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-15 09:47:38 +02:00
um This is the 5.4.134 stable release 2021-07-20 16:30:12 +02:00
unicore32
x86 BACKPORT: crypto: blake2s - share the "shash" API boilerplate code 2021-10-23 19:32:26 -07:00
xtensa xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG 2021-09-12 08:56:39 +02:00
.gitignore
Kconfig