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

index 8283664a1f24b5f114607e41c07b9a247c122efe..9db1fd6d9f0e096765aafc108f3a0b13c60fce9d 100644 (file)
@@ -2,11 +2,6 @@
 
 menu "Accelerated Cryptographic Algorithms for CPU (mips)"
 
-config CRYPTO_POLY1305_MIPS
-       tristate
-       select CRYPTO_ARCH_HAVE_LIB_POLY1305
-       default CRYPTO_LIB_POLY1305_INTERNAL
-
 config CRYPTO_MD5_OCTEON
        tristate "Digests: MD5 (OCTEON)"
        depends on CPU_CAVIUM_OCTEON
@@ -47,10 +42,4 @@ config CRYPTO_SHA512_OCTEON
 
          Architecture: mips OCTEON using crypto instructions, when available
 
-config CRYPTO_CHACHA_MIPS
-       tristate
-       depends on CPU_MIPS32_R2
-       select CRYPTO_ARCH_HAVE_LIB_CHACHA
-       default CRYPTO_LIB_CHACHA_INTERNAL
-
 endmenu
index fddc8828141238f291ec013821a63e105e56bb5f..5adb631a69c18cb2b1806ca88746a3e8fe1c86fe 100644 (file)
@@ -3,20 +3,3 @@
 # Makefile for MIPS crypto files..
 #
 
-obj-$(CONFIG_CRYPTO_CHACHA_MIPS) += chacha-mips.o
-chacha-mips-y := chacha-core.o chacha-glue.o
-AFLAGS_chacha-core.o += -O2 # needed to fill branch delay slots
-
-obj-$(CONFIG_CRYPTO_POLY1305_MIPS) += poly1305-mips.o
-poly1305-mips-y := poly1305-core.o poly1305-glue.o
-
-perlasm-flavour-$(CONFIG_32BIT) := o32
-perlasm-flavour-$(CONFIG_64BIT) := 64
-
-quiet_cmd_perlasm = PERLASM $@
-      cmd_perlasm = $(PERL) $(<) $(perlasm-flavour-y) $(@)
-
-$(obj)/poly1305-core.S: $(src)/poly1305-mips.pl FORCE
-       $(call if_changed,perlasm)
-
-targets += poly1305-core.S
index 9c024e6d5e54c057c3dd196f7a6f7fc6eb8feda9..9d75845ef78e186f59495eb7792157ff8ca24aad 100644 (file)
@@ -3,6 +3,8 @@
 # Makefile for MIPS-specific library files..
 #
 
+obj-y  += crypto/
+
 lib-y  += bitops.o csum_partial.o delay.o memcpy.o memset.o \
           mips-atomic.o strncpy_user.o \
           strnlen_user.o uncached.o
diff --git a/arch/mips/lib/crypto/.gitignore b/arch/mips/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/mips/lib/crypto/Kconfig b/arch/mips/lib/crypto/Kconfig
new file mode 100644 (file)
index 0000000..5b82ba7
--- /dev/null
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config CRYPTO_CHACHA_MIPS
+       tristate
+       depends on CPU_MIPS32_R2
+       default CRYPTO_LIB_CHACHA_INTERNAL
+       select CRYPTO_ARCH_HAVE_LIB_CHACHA
+
+config CRYPTO_POLY1305_MIPS
+       tristate
+       default CRYPTO_LIB_POLY1305_INTERNAL
+       select CRYPTO_ARCH_HAVE_LIB_POLY1305
diff --git a/arch/mips/lib/crypto/Makefile b/arch/mips/lib/crypto/Makefile
new file mode 100644 (file)
index 0000000..804488c
--- /dev/null
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-$(CONFIG_CRYPTO_CHACHA_MIPS) += chacha-mips.o
+chacha-mips-y := chacha-core.o chacha-glue.o
+AFLAGS_chacha-core.o += -O2 # needed to fill branch delay slots
+
+obj-$(CONFIG_CRYPTO_POLY1305_MIPS) += poly1305-mips.o
+poly1305-mips-y := poly1305-core.o poly1305-glue.o
+
+perlasm-flavour-$(CONFIG_32BIT) := o32
+perlasm-flavour-$(CONFIG_64BIT) := 64
+
+quiet_cmd_perlasm = PERLASM $@
+      cmd_perlasm = $(PERL) $(<) $(perlasm-flavour-y) $(@)
+
+$(obj)/poly1305-core.S: $(src)/poly1305-mips.pl FORCE
+       $(call if_changed,perlasm)
+
+targets += poly1305-core.S
index 7395234d654b798a0fcfe85b866ef297fadb2129..c5c01bc3569d5c621017e226528315df729d871f 100644 (file)
@@ -162,6 +162,9 @@ endif
 if ARM64
 source "arch/arm64/lib/crypto/Kconfig"
 endif
+if MIPS
+source "arch/mips/lib/crypto/Kconfig"
+endif
 endif
 
 endmenu