]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
crypto: riscv - move library functions to arch/riscv/lib/crypto/
authorEric Biggers <ebiggers@google.com>
Tue, 22 Apr 2025 15:27:12 +0000 (08:27 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 28 Apr 2025 11:40:53 +0000 (19:40 +0800)
Continue disentangling the crypto library functions from the generic
crypto infrastructure by moving the riscv ChaCha library functions into
a new directory arch/riscv/lib/crypto/ that does not depend on CRYPTO.
This mirrors the distinction between crypto/ and lib/crypto/.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/riscv/crypto/Kconfig
arch/riscv/crypto/Makefile
arch/riscv/lib/Makefile
arch/riscv/lib/crypto/Kconfig [new file with mode: 0644]
arch/riscv/lib/crypto/Makefile [new file with mode: 0644]
arch/riscv/lib/crypto/chacha-riscv64-glue.c [moved from arch/riscv/crypto/chacha-riscv64-glue.c with 100% similarity]
arch/riscv/lib/crypto/chacha-riscv64-zvkb.S [moved from arch/riscv/crypto/chacha-riscv64-zvkb.S with 100% similarity]
lib/crypto/Kconfig

index 27a1f26d41bdeaabcebac31e16a3486a9080ec2d..4863be2a4ec2fd393666386c74e6f9fde5226d01 100644 (file)
@@ -18,13 +18,6 @@ config CRYPTO_AES_RISCV64
          - Zvkb vector crypto extension (CTR)
          - Zvkg vector crypto extension (XTS)
 
-config CRYPTO_CHACHA_RISCV64
-       tristate
-       depends on 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
-       select CRYPTO_ARCH_HAVE_LIB_CHACHA
-       select CRYPTO_LIB_CHACHA_GENERIC
-       default CRYPTO_LIB_CHACHA_INTERNAL
-
 config CRYPTO_GHASH_RISCV64
        tristate "Hash functions: GHASH"
        depends on 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
index 247c7bc7288ceccfd17e34e557b842599ff89a41..4ae9bf762e90715da543aa15850197a88f9b1951 100644 (file)
@@ -4,9 +4,6 @@ obj-$(CONFIG_CRYPTO_AES_RISCV64) += aes-riscv64.o
 aes-riscv64-y := aes-riscv64-glue.o aes-riscv64-zvkned.o \
                 aes-riscv64-zvkned-zvbb-zvkg.o aes-riscv64-zvkned-zvkb.o
 
-obj-$(CONFIG_CRYPTO_CHACHA_RISCV64) += chacha-riscv64.o
-chacha-riscv64-y := chacha-riscv64-glue.o chacha-riscv64-zvkb.o
-
 obj-$(CONFIG_CRYPTO_GHASH_RISCV64) += ghash-riscv64.o
 ghash-riscv64-y := ghash-riscv64-glue.o ghash-riscv64-zvkg.o
 
index b1c46153606a67d7790848ddc8380b7c7752b9e5..0baec92d2f55b8320281bded76442f9a31581622 100644 (file)
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
+obj-y                  += crypto/
 lib-y                  += delay.o
 lib-y                  += memcpy.o
 lib-y                  += memset.o
diff --git a/arch/riscv/lib/crypto/Kconfig b/arch/riscv/lib/crypto/Kconfig
new file mode 100644 (file)
index 0000000..46ce2a7
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config CRYPTO_CHACHA_RISCV64
+       tristate
+       depends on 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
+       default CRYPTO_LIB_CHACHA_INTERNAL
+       select CRYPTO_ARCH_HAVE_LIB_CHACHA
+       select CRYPTO_LIB_CHACHA_GENERIC
diff --git a/arch/riscv/lib/crypto/Makefile b/arch/riscv/lib/crypto/Makefile
new file mode 100644 (file)
index 0000000..e27b78f
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-$(CONFIG_CRYPTO_CHACHA_RISCV64) += chacha-riscv64.o
+chacha-riscv64-y := chacha-riscv64-glue.o chacha-riscv64-zvkb.o
index 4b3e94ed84bb65057447b4be90064a520ecd26a7..0b06c25eb38a5a83a8ec745c011a44efaf1a26df 100644 (file)
@@ -168,6 +168,9 @@ endif
 if PPC
 source "arch/powerpc/lib/crypto/Kconfig"
 endif
+if RISCV
+source "arch/riscv/lib/crypto/Kconfig"
+endif
 endif
 
 endmenu