]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
crypto: arm64 - move library functions to arch/arm64/lib/crypto/
authorEric Biggers <ebiggers@google.com>
Tue, 22 Apr 2025 15:27:09 +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 arm64 ChaCha and Poly1305 library
functions into a new directory arch/arm64/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/arm64/crypto/Kconfig
arch/arm64/crypto/Makefile
arch/arm64/lib/Makefile
arch/arm64/lib/crypto/.gitignore [new file with mode: 0644]
arch/arm64/lib/crypto/Kconfig [new file with mode: 0644]
arch/arm64/lib/crypto/Makefile [new file with mode: 0644]
arch/arm64/lib/crypto/chacha-neon-core.S [moved from arch/arm64/crypto/chacha-neon-core.S with 100% similarity]
arch/arm64/lib/crypto/chacha-neon-glue.c [moved from arch/arm64/crypto/chacha-neon-glue.c with 100% similarity]
arch/arm64/lib/crypto/poly1305-armv8.pl [moved from arch/arm64/crypto/poly1305-armv8.pl with 100% similarity]
arch/arm64/lib/crypto/poly1305-glue.c [moved from arch/arm64/crypto/poly1305-glue.c with 100% similarity]
lib/crypto/Kconfig

index 704d0b7e1d13796aa8267ab207f69cb47cd5ff1b..55a7d87a67690649a998e8e14ebe4caa0c03726a 100644 (file)
@@ -25,12 +25,6 @@ config CRYPTO_NHPOLY1305_NEON
          Architecture: arm64 using:
          - NEON (Advanced SIMD) extensions
 
-config CRYPTO_POLY1305_NEON
-       tristate
-       depends on KERNEL_MODE_NEON
-       select CRYPTO_ARCH_HAVE_LIB_POLY1305
-       default CRYPTO_LIB_POLY1305_INTERNAL
-
 config CRYPTO_SHA1_ARM64_CE
        tristate "Hash functions: SHA-1 (ARMv8 Crypto Extensions)"
        depends on KERNEL_MODE_NEON
@@ -180,13 +174,6 @@ config CRYPTO_AES_ARM64_NEON_BLK
          Architecture: arm64 using:
          - NEON (Advanced SIMD) extensions
 
-config CRYPTO_CHACHA20_NEON
-       tristate
-       depends on KERNEL_MODE_NEON
-       select CRYPTO_LIB_CHACHA_GENERIC
-       select CRYPTO_ARCH_HAVE_LIB_CHACHA
-       default CRYPTO_LIB_CHACHA_INTERNAL
-
 config CRYPTO_AES_ARM64_BS
        tristate "Ciphers: AES, modes: ECB/CBC/CTR/XCTR/XTS modes (bit-sliced NEON)"
        depends on KERNEL_MODE_NEON
index e7139c4768ce4e909834bfcaa479f63bcd9a4aa7..089ae3ddde8109875b170cab95d2249f0824f2c9 100644 (file)
@@ -62,13 +62,6 @@ sha256-arm64-y := sha256-glue.o sha256-core.o
 obj-$(CONFIG_CRYPTO_SHA512_ARM64) += sha512-arm64.o
 sha512-arm64-y := sha512-glue.o sha512-core.o
 
-obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
-chacha-neon-y := chacha-neon-core.o chacha-neon-glue.o
-
-obj-$(CONFIG_CRYPTO_POLY1305_NEON) += poly1305-neon.o
-poly1305-neon-y := poly1305-core.o poly1305-glue.o
-AFLAGS_poly1305-core.o += -Dpoly1305_init=poly1305_init_arm64
-
 obj-$(CONFIG_CRYPTO_NHPOLY1305_NEON) += nhpoly1305-neon.o
 nhpoly1305-neon-y := nh-neon-core.o nhpoly1305-neon-glue.o
 
@@ -87,4 +80,4 @@ $(obj)/%-core.S: $(src)/%-armv8.pl
 $(obj)/sha256-core.S: $(src)/sha512-armv8.pl
        $(call cmd,perlasm)
 
-clean-files += poly1305-core.S sha256-core.S sha512-core.S
+clean-files += sha256-core.S sha512-core.S
index 4d49dff721a84e5e6cd4f28ed727d7002adc946a..25be7825f28d899d6266ec229123415fbc26c717 100644 (file)
@@ -1,4 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
+
+obj-y += crypto/
+
 lib-y          := clear_user.o delay.o copy_from_user.o                \
                   copy_to_user.o copy_page.o                           \
                   clear_page.o csum.o insn.o memchr.o memcpy.o         \
diff --git a/arch/arm64/lib/crypto/.gitignore b/arch/arm64/lib/crypto/.gitignore
new file mode 100644 (file)
index 0000000..0d47d4f
--- /dev/null
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+poly1305-core.S
diff --git a/arch/arm64/lib/crypto/Kconfig b/arch/arm64/lib/crypto/Kconfig
new file mode 100644 (file)
index 0000000..1693115
--- /dev/null
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config CRYPTO_CHACHA20_NEON
+       tristate
+       depends on KERNEL_MODE_NEON
+       default CRYPTO_LIB_CHACHA_INTERNAL
+       select CRYPTO_LIB_CHACHA_GENERIC
+       select CRYPTO_ARCH_HAVE_LIB_CHACHA
+
+config CRYPTO_POLY1305_NEON
+       tristate
+       depends on KERNEL_MODE_NEON
+       default CRYPTO_LIB_POLY1305_INTERNAL
+       select CRYPTO_ARCH_HAVE_LIB_POLY1305
diff --git a/arch/arm64/lib/crypto/Makefile b/arch/arm64/lib/crypto/Makefile
new file mode 100644 (file)
index 0000000..ac624c3
--- /dev/null
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
+chacha-neon-y := chacha-neon-core.o chacha-neon-glue.o
+
+obj-$(CONFIG_CRYPTO_POLY1305_NEON) += poly1305-neon.o
+poly1305-neon-y := poly1305-core.o poly1305-glue.o
+AFLAGS_poly1305-core.o += -Dpoly1305_init=poly1305_init_arm64
+
+quiet_cmd_perlasm = PERLASM $@
+      cmd_perlasm = $(PERL) $(<) void $(@)
+
+$(obj)/%-core.S: $(src)/%-armv8.pl
+       $(call cmd,perlasm)
+
+clean-files += poly1305-core.S
index 59135009e4f02c49f385b391966d581d56d0a4a5..7395234d654b798a0fcfe85b866ef297fadb2129 100644 (file)
@@ -159,6 +159,9 @@ if !KMSAN # avoid false positives from assembly
 if ARM
 source "arch/arm/lib/crypto/Kconfig"
 endif
+if ARM64
+source "arch/arm64/lib/crypto/Kconfig"
+endif
 endif
 
 endmenu