Commit 7033b937 authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu
Browse files

crypto: lib - create utils module and move __crypto_memneq into it

As requested at
https://lore.kernel.org/r/YtEgzHuuMts0YBCz@gondor.apana.org.au

, move
__crypto_memneq into lib/crypto/ and put it under a new tristate.  The
tristate is CRYPTO_LIB_UTILS, and it builds a module libcryptoutils.  As
more crypto library utilities are being added, this creates a single
place for them to go without cluttering up the main lib directory.

The module's main file will be lib/crypto/utils.c.  However, leave
memneq.c as its own file because of its nonstandard license.

Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Reviewed-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 908f2427
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ source "crypto/async_tx/Kconfig"
#
menuconfig CRYPTO
	tristate "Cryptographic API"
	select LIB_MEMNEQ
	select CRYPTO_LIB_UTILS
	help
	  This option provides the core Cryptographic API.

+0 −3
Original line number Diff line number Diff line
@@ -127,9 +127,6 @@ config TRACE_MMIO_ACCESS

source "lib/crypto/Kconfig"

config LIB_MEMNEQ
	bool

config CRC_CCITT
	tristate "CRC-CCITT functions"
	help
+0 −1
Original line number Diff line number Diff line
@@ -253,7 +253,6 @@ obj-$(CONFIG_DIMLIB) += dim/
obj-$(CONFIG_SIGNATURE) += digsig.o

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

obj-$(CONFIG_GENERIC_STRNCPY_FROM_USER) += strncpy_from_user.o
obj-$(CONFIG_GENERIC_STRNLEN_USER) += strnlen_user.o
+4 −1
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@

menu "Crypto library routines"

config CRYPTO_LIB_UTILS
	tristate

config CRYPTO_LIB_AES
	tristate

@@ -71,7 +74,7 @@ config CRYPTO_LIB_CURVE25519
	tristate "Curve25519 scalar multiplication library"
	depends on CRYPTO_ARCH_HAVE_LIB_CURVE25519 || !CRYPTO_ARCH_HAVE_LIB_CURVE25519
	select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n
	select LIB_MEMNEQ
	select CRYPTO_LIB_UTILS
	help
	  Enable the Curve25519 library interface. This interface may be
	  fulfilled by either the generic implementation or an arch-specific
+3 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0

obj-$(CONFIG_CRYPTO_LIB_UTILS)			+= libcryptoutils.o
libcryptoutils-y				:= memneq.o

# chacha is used by the /dev/random driver which is always builtin
obj-y						+= chacha.o
obj-$(CONFIG_CRYPTO_LIB_CHACHA_GENERIC)		+= libchacha.o
Loading