summaryrefslogtreecommitdiffstats
path: root/crypto/Makefile
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2025-04-05 11:26:02 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2025-04-07 13:22:28 +0800
commit4aa6dc909e400b247bd3abf29f805d49a9c140bf (patch)
treea86c166bc8c691851f43489ceb97a7af89fdda62 /crypto/Makefile
parentcrypto: riscv/chacha - implement library instead of skcipher (diff)
downloadlinux-4aa6dc909e400b247bd3abf29f805d49a9c140bf.tar.gz
linux-4aa6dc909e400b247bd3abf29f805d49a9c140bf.zip
crypto: chacha - centralize the skcipher wrappers for arch code
Following the example of the crc32 and crc32c code, make the crypto subsystem register both generic and architecture-optimized chacha20, xchacha20, and xchacha12 skcipher algorithms, all implemented on top of the appropriate library functions. This eliminates the need for every architecture to implement the same skcipher glue code. To register the architecture-optimized skciphers only when architecture-optimized code is actually being used, add a function chacha_is_arch_optimized() and make each arch implement it. Change each architecture's ChaCha module_init function to arch_initcall so that the CPU feature detection is guaranteed to run before chacha_is_arch_optimized() gets called by crypto/chacha.c. In the case of s390, remove the CPU feature based module autoloading, which is no longer needed since the module just gets pulled in via function linkage. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/Makefile')
-rw-r--r--crypto/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/Makefile b/crypto/Makefile
index 0e6ab5ffd3f7..98510a2aa0b1 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -148,7 +148,8 @@ obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o
obj-$(CONFIG_CRYPTO_ANUBIS) += anubis.o
obj-$(CONFIG_CRYPTO_SEED) += seed.o
obj-$(CONFIG_CRYPTO_ARIA) += aria_generic.o
-obj-$(CONFIG_CRYPTO_CHACHA20) += chacha_generic.o
+obj-$(CONFIG_CRYPTO_CHACHA20) += chacha.o
+CFLAGS_chacha.o += -DARCH=$(ARCH)
obj-$(CONFIG_CRYPTO_POLY1305) += poly1305_generic.o
obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o
obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o