]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: move gf128mul library into lib/crypto
authorArd Biesheuvel <ardb@kernel.org>
Thu, 3 Nov 2022 19:22:57 +0000 (20:22 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 11 Nov 2022 10:14:59 +0000 (18:14 +0800)
The gf128mul library does not depend on the crypto API at all, so it can
be moved into lib/crypto. This will allow us to use it in other library
code in a subsequent patch without having to depend on CONFIG_CRYPTO.

While at it, change the Kconfig symbol name to align with other crypto
library implementations. However, the source file name is retained, as
it is reflected in the module .ko filename, and changing this might
break things for users.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm/crypto/Kconfig
arch/arm64/crypto/Kconfig
crypto/Kconfig
crypto/Makefile
drivers/crypto/chelsio/Kconfig
lib/crypto/Kconfig
lib/crypto/Makefile
lib/crypto/gf128mul.c [moved from crypto/gf128mul.c with 100% similarity]

index 3858c4d4cb98854d023075626878bc928062a42d..7b2b7d043d9be9e6f5c432badf2adb9938883eaf 100644 (file)
@@ -18,7 +18,7 @@ config CRYPTO_GHASH_ARM_CE
        depends on KERNEL_MODE_NEON
        select CRYPTO_HASH
        select CRYPTO_CRYPTD
-       select CRYPTO_GF128MUL
+       select CRYPTO_LIB_GF128MUL
        help
          GCM GHASH function (NIST SP800-38D)
 
index 6793d5bc3ee53ee71e243b0c7e59c2731e0704d7..6d06b448a66e0ca6d62c728e04754ac2cbb65f6e 100644 (file)
@@ -6,8 +6,8 @@ config CRYPTO_GHASH_ARM64_CE
        tristate "Hash functions: GHASH (ARMv8 Crypto Extensions)"
        depends on KERNEL_MODE_NEON
        select CRYPTO_HASH
-       select CRYPTO_GF128MUL
        select CRYPTO_LIB_AES
+       select CRYPTO_LIB_GF128MUL
        select CRYPTO_AEAD
        help
          GCM GHASH function (NIST SP800-38D)
index d779667671b23f03c57b5e887627f06da775ef2f..9c86f704515761c47bbafc579827651b2810cf9b 100644 (file)
@@ -175,9 +175,6 @@ config CRYPTO_MANAGER_EXTRA_TESTS
          This is intended for developer use only, as these tests take much
          longer to run than the normal self tests.
 
-config CRYPTO_GF128MUL
-       tristate
-
 config CRYPTO_NULL
        tristate "Null algorithms"
        select CRYPTO_NULL2
@@ -714,9 +711,9 @@ config CRYPTO_KEYWRAP
 
 config CRYPTO_LRW
        tristate "LRW (Liskov Rivest Wagner)"
+       select CRYPTO_LIB_GF128MUL
        select CRYPTO_SKCIPHER
        select CRYPTO_MANAGER
-       select CRYPTO_GF128MUL
        select CRYPTO_ECB
        help
          LRW (Liskov Rivest Wagner) mode
@@ -926,8 +923,8 @@ config CRYPTO_CMAC
 
 config CRYPTO_GHASH
        tristate "GHASH"
-       select CRYPTO_GF128MUL
        select CRYPTO_HASH
+       select CRYPTO_LIB_GF128MUL
        help
          GCM GHASH function (NIST SP800-38D)
 
@@ -967,8 +964,8 @@ config CRYPTO_MICHAEL_MIC
 
 config CRYPTO_POLYVAL
        tristate
-       select CRYPTO_GF128MUL
        select CRYPTO_HASH
+       select CRYPTO_LIB_GF128MUL
        help
          POLYVAL hash function for HCTR2
 
index 303b21c43df05a5e4784b355150daadbd9ec8d66..d0126c915834b2f09b3ed42ab712a69b26b47258 100644 (file)
@@ -85,7 +85,6 @@ obj-$(CONFIG_CRYPTO_WP512) += wp512.o
 CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns)  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
 obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b_generic.o
 CFLAGS_blake2b_generic.o := -Wframe-larger-than=4096 #  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105930
-obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o
 obj-$(CONFIG_CRYPTO_ECB) += ecb.o
 obj-$(CONFIG_CRYPTO_CBC) += cbc.o
 obj-$(CONFIG_CRYPTO_CFB) += cfb.o
index f886401af13e7b271ccb94d62aa8c4a117ac0552..5dd3f6a4781a2c963c0bc1023686f643d933712b 100644 (file)
@@ -3,11 +3,11 @@ config CRYPTO_DEV_CHELSIO
        tristate "Chelsio Crypto Co-processor Driver"
        depends on CHELSIO_T4
        select CRYPTO_LIB_AES
+       select CRYPTO_LIB_GF128MUL
        select CRYPTO_SHA1
        select CRYPTO_SHA256
        select CRYPTO_SHA512
        select CRYPTO_AUTHENC
-       select CRYPTO_GF128MUL
        help
          The Chelsio Crypto Co-processor driver for T6 adapters.
 
index 7e9683e9f5c6364514521d226c4e8429ed88088b..6767d86959de8f9ce02038f26abdf314c6a2cf2c 100644 (file)
@@ -11,6 +11,9 @@ config CRYPTO_LIB_AES
 config CRYPTO_LIB_ARC4
        tristate
 
+config CRYPTO_LIB_GF128MUL
+       tristate
+
 config CRYPTO_ARCH_HAVE_LIB_BLAKE2S
        bool
        help
index c852f067ab06019e35205b29ecaeeb6fcc122ee4..7000eeb72286e25378c0f56e0c14d3f767d38a1e 100644 (file)
@@ -13,6 +13,8 @@ libaes-y                                      := aes.o
 obj-$(CONFIG_CRYPTO_LIB_ARC4)                  += libarc4.o
 libarc4-y                                      := arc4.o
 
+obj-$(CONFIG_CRYPTO_LIB_GF128MUL)              += gf128mul.o
+
 # blake2s is used by the /dev/random driver which is always builtin
 obj-y                                          += libblake2s.o
 libblake2s-y                                   := blake2s.o
similarity index 100%
rename from crypto/gf128mul.c
rename to lib/crypto/gf128mul.c