Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: lib/Kconfig - Fix lib built-in failure when arch is modular

The HAVE_ARCH Kconfig options in lib/crypto try to solve the
modular versus built-in problem, but it still fails when the
the LIB option (e.g., CRYPTO_LIB_CURVE25519) is selected externally.

Fix this by introducing a level of indirection with ARCH_MAY_HAVE
Kconfig options, these then go on to select the ARCH_HAVE options
if the ARCH Kconfig options matches that of the LIB option.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501230223.ikroNDr1-lkp@intel.com/
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

+26 -16
+3 -3
arch/arm/crypto/Kconfig
··· 6 6 tristate "Public key crypto: Curve25519 (NEON)" 7 7 depends on KERNEL_MODE_NEON 8 8 select CRYPTO_LIB_CURVE25519_GENERIC 9 - select CRYPTO_ARCH_HAVE_LIB_CURVE25519 9 + select CRYPTO_ARCH_MAY_HAVE_LIB_CURVE25519 10 10 help 11 11 Curve25519 algorithm 12 12 ··· 47 47 config CRYPTO_POLY1305_ARM 48 48 tristate "Hash functions: Poly1305 (NEON)" 49 49 select CRYPTO_HASH 50 - select CRYPTO_ARCH_HAVE_LIB_POLY1305 50 + select CRYPTO_ARCH_MAY_HAVE_LIB_POLY1305 51 51 help 52 52 Poly1305 authenticator algorithm (RFC7539) 53 53 ··· 214 214 config CRYPTO_CHACHA20_NEON 215 215 tristate "Ciphers: ChaCha20, XChaCha20, XChaCha12 (NEON)" 216 216 select CRYPTO_SKCIPHER 217 - select CRYPTO_ARCH_HAVE_LIB_CHACHA 217 + select CRYPTO_ARCH_MAY_HAVE_LIB_CHACHA 218 218 help 219 219 Length-preserving ciphers: ChaCha20, XChaCha20, and XChaCha12 220 220 stream cipher algorithms
+2 -2
arch/powerpc/crypto/Kconfig
··· 6 6 tristate "Public key crypto: Curve25519 (PowerPC64)" 7 7 depends on PPC64 && CPU_LITTLE_ENDIAN 8 8 select CRYPTO_LIB_CURVE25519_GENERIC 9 - select CRYPTO_ARCH_HAVE_LIB_CURVE25519 9 + select CRYPTO_ARCH_MAY_HAVE_LIB_CURVE25519 10 10 help 11 11 Curve25519 algorithm 12 12 ··· 95 95 depends on PPC64 && CPU_LITTLE_ENDIAN && VSX 96 96 select CRYPTO_SKCIPHER 97 97 select CRYPTO_LIB_CHACHA_GENERIC 98 - select CRYPTO_ARCH_HAVE_LIB_CHACHA 98 + select CRYPTO_ARCH_MAY_HAVE_LIB_CHACHA 99 99 help 100 100 Length-preserving ciphers: ChaCha20, XChaCha20, and XChaCha12 101 101 stream cipher algorithms
+3 -3
arch/x86/crypto/Kconfig
··· 6 6 tristate "Public key crypto: Curve25519 (ADX)" 7 7 depends on X86 && 64BIT 8 8 select CRYPTO_LIB_CURVE25519_GENERIC 9 - select CRYPTO_ARCH_HAVE_LIB_CURVE25519 9 + select CRYPTO_ARCH_MAY_HAVE_LIB_CURVE25519 10 10 help 11 11 Curve25519 algorithm 12 12 ··· 352 352 depends on X86 && 64BIT 353 353 select CRYPTO_SKCIPHER 354 354 select CRYPTO_LIB_CHACHA_GENERIC 355 - select CRYPTO_ARCH_HAVE_LIB_CHACHA 355 + select CRYPTO_ARCH_MAY_HAVE_LIB_CHACHA 356 356 help 357 357 Length-preserving ciphers: ChaCha20, XChaCha20, and XChaCha12 358 358 stream cipher algorithms ··· 420 420 tristate "Hash functions: Poly1305 (SSE2/AVX2)" 421 421 depends on X86 && 64BIT 422 422 select CRYPTO_LIB_POLY1305_GENERIC 423 - select CRYPTO_ARCH_HAVE_LIB_POLY1305 423 + select CRYPTO_ARCH_MAY_HAVE_LIB_POLY1305 424 424 help 425 425 Poly1305 authenticator algorithm (RFC7539) 426 426
+18 -8
lib/crypto/Kconfig
··· 42 42 of CRYPTO_LIB_BLAKE2S. 43 43 44 44 config CRYPTO_ARCH_HAVE_LIB_CHACHA 45 - tristate 45 + bool 46 46 help 47 47 Declares whether the architecture provides an arch-specific 48 48 accelerated implementation of the ChaCha library interface, 49 49 either builtin or as a module. 50 + 51 + config CRYPTO_ARCH_MAY_HAVE_LIB_CHACHA 52 + tristate 53 + select CRYPTO_ARCH_HAVE_LIB_CHACHA if CRYPTO_LIB_CHACHA=m 54 + select CRYPTO_ARCH_HAVE_LIB_CHACHA if CRYPTO_ARCH_MAY_HAVE_LIB_CHACHA=y 50 55 51 56 config CRYPTO_LIB_CHACHA_GENERIC 52 57 tristate ··· 65 60 66 61 config CRYPTO_LIB_CHACHA 67 62 tristate "ChaCha library interface" 68 - depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA 69 63 select CRYPTO_LIB_CHACHA_GENERIC if CRYPTO_ARCH_HAVE_LIB_CHACHA=n 70 64 help 71 65 Enable the ChaCha library interface. This interface may be fulfilled ··· 72 68 is available and enabled. 73 69 74 70 config CRYPTO_ARCH_HAVE_LIB_CURVE25519 75 - tristate 71 + bool 76 72 help 77 73 Declares whether the architecture provides an arch-specific 78 74 accelerated implementation of the Curve25519 library interface, 79 75 either builtin or as a module. 76 + 77 + config CRYPTO_ARCH_MAY_HAVE_LIB_CURVE25519 78 + tristate 79 + select CRYPTO_ARCH_HAVE_LIB_CURVE25519 if CRYPTO_LIB_CURVE25519=m 80 + select CRYPTO_ARCH_HAVE_LIB_CURVE25519 if CRYPTO_ARCH_MAY_HAVE_LIB_CURVE25519=y 80 81 81 82 config CRYPTO_LIB_CURVE25519_GENERIC 82 83 tristate ··· 94 85 95 86 config CRYPTO_LIB_CURVE25519 96 87 tristate "Curve25519 scalar multiplication library" 97 - depends on CRYPTO_ARCH_HAVE_LIB_CURVE25519 || !CRYPTO_ARCH_HAVE_LIB_CURVE25519 98 88 select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n 99 89 select CRYPTO_LIB_UTILS 100 90 help ··· 112 104 default 1 113 105 114 106 config CRYPTO_ARCH_HAVE_LIB_POLY1305 115 - tristate 107 + bool 116 108 help 117 109 Declares whether the architecture provides an arch-specific 118 110 accelerated implementation of the Poly1305 library interface, 119 111 either builtin or as a module. 112 + 113 + config CRYPTO_ARCH_MAY_HAVE_LIB_POLY1305 114 + tristate 115 + select CRYPTO_ARCH_HAVE_LIB_POLY1305 if CRYPTO_LIB_POLY1305=m 116 + select CRYPTO_ARCH_HAVE_LIB_POLY1305 if CRYPTO_ARCH_MAY_HAVE_LIB_POLY1305=y 120 117 121 118 config CRYPTO_LIB_POLY1305_GENERIC 122 119 tristate ··· 134 121 135 122 config CRYPTO_LIB_POLY1305 136 123 tristate "Poly1305 library interface" 137 - depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305 138 124 select CRYPTO_LIB_POLY1305_GENERIC if CRYPTO_ARCH_HAVE_LIB_POLY1305=n 139 125 help 140 126 Enable the Poly1305 library interface. This interface may be fulfilled ··· 142 130 143 131 config CRYPTO_LIB_CHACHA20POLY1305 144 132 tristate "ChaCha20-Poly1305 AEAD support (8-byte nonce library version)" 145 - depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA 146 - depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305 147 133 depends on CRYPTO 148 134 select CRYPTO_LIB_CHACHA 149 135 select CRYPTO_LIB_POLY1305