From 3ea91323fe32011092fc75575d9a074ab374d673 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 22 Apr 2025 08:27:13 -0700 Subject: [PATCH] crypto: s390 - move library functions to arch/s390/lib/crypto/ Continue disentangling the crypto library functions from the generic crypto infrastructure by moving the s390 ChaCha library functions into a new directory arch/s390/lib/crypto/ that does not depend on CRYPTO. This mirrors the distinction between crypto/ and lib/crypto/. Acked-by: Heiko Carstens Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu --- arch/s390/crypto/Kconfig | 6 ------ arch/s390/crypto/Makefile | 3 --- arch/s390/lib/Makefile | 1 + arch/s390/lib/crypto/Kconfig | 7 +++++++ arch/s390/lib/crypto/Makefile | 4 ++++ arch/s390/{ => lib}/crypto/chacha-glue.c | 0 arch/s390/{ => lib}/crypto/chacha-s390.S | 0 arch/s390/{ => lib}/crypto/chacha-s390.h | 0 lib/crypto/Kconfig | 3 +++ 9 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 arch/s390/lib/crypto/Kconfig create mode 100644 arch/s390/lib/crypto/Makefile rename arch/s390/{ => lib}/crypto/chacha-glue.c (100%) rename arch/s390/{ => lib}/crypto/chacha-s390.S (100%) rename arch/s390/{ => lib}/crypto/chacha-s390.h (100%) diff --git a/arch/s390/crypto/Kconfig b/arch/s390/crypto/Kconfig index e88d9cd256ef..a2bfd6eef0ca 100644 --- a/arch/s390/crypto/Kconfig +++ b/arch/s390/crypto/Kconfig @@ -99,12 +99,6 @@ config CRYPTO_DES_S390 As of z990 the ECB and CBC mode are hardware accelerated. As of z196 the CTR mode is hardware accelerated. -config CRYPTO_CHACHA_S390 - tristate - select CRYPTO_LIB_CHACHA_GENERIC - select CRYPTO_ARCH_HAVE_LIB_CHACHA - default CRYPTO_LIB_CHACHA_INTERNAL - config CRYPTO_HMAC_S390 tristate "Keyed-hash message authentication code: HMAC" select CRYPTO_HASH diff --git a/arch/s390/crypto/Makefile b/arch/s390/crypto/Makefile index 14dafadbcbed..e3853774e1a3 100644 --- a/arch/s390/crypto/Makefile +++ b/arch/s390/crypto/Makefile @@ -11,10 +11,7 @@ obj-$(CONFIG_CRYPTO_SHA3_512_S390) += sha3_512_s390.o sha_common.o obj-$(CONFIG_CRYPTO_DES_S390) += des_s390.o obj-$(CONFIG_CRYPTO_AES_S390) += aes_s390.o obj-$(CONFIG_CRYPTO_PAES_S390) += paes_s390.o -obj-$(CONFIG_CRYPTO_CHACHA_S390) += chacha_s390.o obj-$(CONFIG_S390_PRNG) += prng.o obj-$(CONFIG_CRYPTO_GHASH_S390) += ghash_s390.o obj-$(CONFIG_CRYPTO_HMAC_S390) += hmac_s390.o obj-y += arch_random.o - -chacha_s390-y := chacha-glue.o chacha-s390.o diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile index 14bbfe50033c..fce4edbe8a07 100644 --- a/arch/s390/lib/Makefile +++ b/arch/s390/lib/Makefile @@ -3,6 +3,7 @@ # Makefile for s390-specific library files.. # +obj-y += crypto/ lib-y += delay.o string.o uaccess.o find.o spinlock.o tishift.o lib-y += csum-partial.o obj-y += mem.o xor.o diff --git a/arch/s390/lib/crypto/Kconfig b/arch/s390/lib/crypto/Kconfig new file mode 100644 index 000000000000..b79fd91af9fe --- /dev/null +++ b/arch/s390/lib/crypto/Kconfig @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config CRYPTO_CHACHA_S390 + tristate + default CRYPTO_LIB_CHACHA_INTERNAL + select CRYPTO_LIB_CHACHA_GENERIC + select CRYPTO_ARCH_HAVE_LIB_CHACHA diff --git a/arch/s390/lib/crypto/Makefile b/arch/s390/lib/crypto/Makefile new file mode 100644 index 000000000000..06c2cf77178e --- /dev/null +++ b/arch/s390/lib/crypto/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only + +obj-$(CONFIG_CRYPTO_CHACHA_S390) += chacha_s390.o +chacha_s390-y := chacha-glue.o chacha-s390.o diff --git a/arch/s390/crypto/chacha-glue.c b/arch/s390/lib/crypto/chacha-glue.c similarity index 100% rename from arch/s390/crypto/chacha-glue.c rename to arch/s390/lib/crypto/chacha-glue.c diff --git a/arch/s390/crypto/chacha-s390.S b/arch/s390/lib/crypto/chacha-s390.S similarity index 100% rename from arch/s390/crypto/chacha-s390.S rename to arch/s390/lib/crypto/chacha-s390.S diff --git a/arch/s390/crypto/chacha-s390.h b/arch/s390/lib/crypto/chacha-s390.h similarity index 100% rename from arch/s390/crypto/chacha-s390.h rename to arch/s390/lib/crypto/chacha-s390.h diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig index 0b06c25eb38a..db19a7acc2fb 100644 --- a/lib/crypto/Kconfig +++ b/lib/crypto/Kconfig @@ -171,6 +171,9 @@ endif if RISCV source "arch/riscv/lib/crypto/Kconfig" endif +if S390 +source "arch/s390/lib/crypto/Kconfig" +endif endif endmenu -- 2.50.1