Skip to content

Commit abfed87

Browse files
zx2c4herbertx
authored andcommitted
crypto: memneq - move into lib/
This is used by code that doesn't need CONFIG_CRYPTO, so move this into lib/ with a Kconfig option so that it can be selected by whatever needs it. This fixes a linker error Zheng pointed out when CRYPTO_MANAGER_DISABLE_TESTS!=y and CRYPTO=m: lib/crypto/curve25519-selftest.o: In function `curve25519_selftest': curve25519-selftest.c:(.init.text+0x60): undefined reference to `__crypto_memneq' curve25519-selftest.c:(.init.text+0xec): undefined reference to `__crypto_memneq' curve25519-selftest.c:(.init.text+0x114): undefined reference to `__crypto_memneq' curve25519-selftest.c:(.init.text+0x154): undefined reference to `__crypto_memneq' Reported-by: Zheng Bin <[email protected]> Cc: Eric Biggers <[email protected]> Cc: [email protected] Fixes: aa12796 ("crypto: lib/curve25519 - re-add selftests") Signed-off-by: Jason A. Donenfeld <[email protected]> Reviewed-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent f2906aa commit abfed87

File tree

6 files changed

+7
-1
lines changed

6 files changed

+7
-1
lines changed

crypto/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ source "crypto/async_tx/Kconfig"
1515
#
1616
menuconfig CRYPTO
1717
tristate "Cryptographic API"
18+
select LIB_MEMNEQ
1819
help
1920
This option provides the core Cryptographic API.
2021

crypto/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55

66
obj-$(CONFIG_CRYPTO) += crypto.o
7-
crypto-y := api.o cipher.o compress.o memneq.o
7+
crypto-y := api.o cipher.o compress.o
88

99
obj-$(CONFIG_CRYPTO_ENGINE) += crypto_engine.o
1010
obj-$(CONFIG_CRYPTO_FIPS) += fips.o

lib/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ config INDIRECT_IOMEM_FALLBACK
120120

121121
source "lib/crypto/Kconfig"
122122

123+
config LIB_MEMNEQ
124+
bool
125+
123126
config CRC_CCITT
124127
tristate "CRC-CCITT functions"
125128
help

lib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ obj-$(CONFIG_DIMLIB) += dim/
251251
obj-$(CONFIG_SIGNATURE) += digsig.o
252252

253253
lib-$(CONFIG_CLZ_TAB) += clz_tab.o
254+
lib-$(CONFIG_LIB_MEMNEQ) += memneq.o
254255

255256
obj-$(CONFIG_GENERIC_STRNCPY_FROM_USER) += strncpy_from_user.o
256257
obj-$(CONFIG_GENERIC_STRNLEN_USER) += strnlen_user.o

lib/crypto/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ config CRYPTO_LIB_CURVE25519
7171
tristate "Curve25519 scalar multiplication library"
7272
depends on CRYPTO_ARCH_HAVE_LIB_CURVE25519 || !CRYPTO_ARCH_HAVE_LIB_CURVE25519
7373
select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n
74+
select LIB_MEMNEQ
7475
help
7576
Enable the Curve25519 library interface. This interface may be
7677
fulfilled by either the generic implementation or an arch-specific
File renamed without changes.

0 commit comments

Comments
 (0)