]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lib/crypto: hash_info: Move hash_info.c into lib/crypto/
authorEric Biggers <ebiggers@kernel.org>
Mon, 30 Jun 2025 17:22:23 +0000 (10:22 -0700)
committerEric Biggers <ebiggers@kernel.org>
Tue, 8 Jul 2025 19:03:44 +0000 (12:03 -0700)
crypto/hash_info.c just contains a couple of arrays that map HASH_ALGO_*
algorithm IDs to properties of those algorithms.  It is compiled only
when CRYPTO_HASH_INFO=y, but currently CRYPTO_HASH_INFO depends on
CRYPTO.  Since this can be useful without the old-school crypto API,
move it into lib/crypto/ so that it no longer depends on CRYPTO.

This eliminates the need for FS_VERITY to select CRYPTO after it's been
converted to use lib/crypto/.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250630172224.46909-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
crypto/Kconfig
crypto/Makefile
lib/crypto/Kconfig
lib/crypto/Makefile
lib/crypto/hash_info.c [moved from crypto/hash_info.c with 100% similarity]

index 3ea1397214e02ac3fa382d738dc90acc47bece14..5d4cf022c57757d37c835d83788116c018571dbd 100644 (file)
@@ -1422,9 +1422,6 @@ config CRYPTO_USER_API_ENABLE_OBSOLETE
 
 endmenu
 
-config CRYPTO_HASH_INFO
-       bool
-
 if !KMSAN # avoid false positives from assembly
 if ARM
 source "arch/arm/crypto/Kconfig"
index 5098fa6d5f39c8516a1c8c50d912a22311c946f3..816607e0e78ce1f58331fdbe4c08eb4f12c1a5c2 100644 (file)
@@ -204,7 +204,6 @@ obj-$(CONFIG_CRYPTO_ECRDSA) += ecrdsa_generic.o
 obj-$(CONFIG_XOR_BLOCKS) += xor.o
 obj-$(CONFIG_ASYNC_CORE) += async_tx/
 obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/
-obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o
 crypto_simd-y := simd.o
 obj-$(CONFIG_CRYPTO_SIMD) += crypto_simd.o
 
index 3305c69085816f414efa4b10a83c41041a83bb07..ee7e1e27ea6a986a60063729b8182db4074a7fde 100644 (file)
@@ -2,6 +2,9 @@
 
 menu "Crypto library routines"
 
+config CRYPTO_HASH_INFO
+       bool
+
 config CRYPTO_LIB_UTILS
        tristate
 
index a887bf103bf055959ab508ad24efc23f892a60aa..533bb1533e19b271d2d363434731c30553d04004 100644 (file)
@@ -8,6 +8,8 @@ quiet_cmd_perlasm = PERLASM $@
 quiet_cmd_perlasm_with_args = PERLASM $@
       cmd_perlasm_with_args = $(PERL) $(<) void $(@)
 
+obj-$(CONFIG_CRYPTO_HASH_INFO)                 += hash_info.o
+
 obj-$(CONFIG_CRYPTO_LIB_UTILS)                 += libcryptoutils.o
 libcryptoutils-y                               := memneq.o utils.o
 
similarity index 100%
rename from crypto/hash_info.c
rename to lib/crypto/hash_info.c