mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
Instead of providing crypto_shash algorithms for the arch-optimized SHA-256 code, instead implement the SHA-256 library. This is much simpler, it makes the SHA-256 library functions be arch-optimized, and it fixes the longstanding issue where the arch-optimized SHA-256 was disabled by default. SHA-256 still remains available through crypto_shash, but individual architectures no longer need to handle it. To merge the scalar, NEON, and CE code all into one module cleanly, add !CPU_V7M as a direct dependency of the CE code. Previously, !CPU_V7M was only a direct dependency of the scalar and NEON code. The result is still the same because CPU_V7M implies !KERNEL_MODE_NEON, so !CPU_V7M was already an indirect dependency of the CE code. To match sha256_blocks_arch(), change the type of the nblocks parameter of the assembly functions from int to size_t. The assembly functions actually already treated it as size_t. While renaming the assembly files, also fix the naming quirk where "sha2" meant sha256. (SHA-512 is also part of SHA-2.) Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
31 lines
762 B
Plaintext
31 lines
762 B
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
config CRYPTO_BLAKE2S_ARM
|
|
bool "Hash functions: BLAKE2s"
|
|
select CRYPTO_ARCH_HAVE_LIB_BLAKE2S
|
|
help
|
|
BLAKE2s cryptographic hash function (RFC 7693)
|
|
|
|
Architecture: arm
|
|
|
|
This is faster than the generic implementations of BLAKE2s and
|
|
BLAKE2b, but slower than the NEON implementation of BLAKE2b.
|
|
There is no NEON implementation of BLAKE2s, since NEON doesn't
|
|
really help with it.
|
|
|
|
config CRYPTO_CHACHA20_NEON
|
|
tristate
|
|
default CRYPTO_LIB_CHACHA
|
|
select CRYPTO_ARCH_HAVE_LIB_CHACHA
|
|
|
|
config CRYPTO_POLY1305_ARM
|
|
tristate
|
|
default CRYPTO_LIB_POLY1305
|
|
select CRYPTO_ARCH_HAVE_LIB_POLY1305
|
|
|
|
config CRYPTO_SHA256_ARM
|
|
tristate
|
|
depends on !CPU_V7M
|
|
default CRYPTO_LIB_SHA256
|
|
select CRYPTO_ARCH_HAVE_LIB_SHA256
|