summaryrefslogtreecommitdiffstats
path: root/crypto/Makefile
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2025-04-28 10:00:26 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2025-05-05 13:38:12 +0800
commit950e5c84118c9e5b06bb9a9b64edf989ee4034df (patch)
treee3fd98ecc23244877fd5397983461f6370f1f044 /crypto/Makefile
parentcrypto: lib/poly1305 - Use block-only interface (diff)
downloadlinux-950e5c84118c9e5b06bb9a9b64edf989ee4034df.tar.gz
linux-950e5c84118c9e5b06bb9a9b64edf989ee4034df.zip
crypto: sha256 - support arch-optimized lib and expose through shash
As has been done for various other algorithms, rework the design of the SHA-256 library to support arch-optimized implementations, and make crypto/sha256.c expose both generic and arch-optimized shash algorithms that wrap the library functions. This allows users of the SHA-256 library functions to take advantage of the arch-optimized code, and this makes it much simpler to integrate SHA-256 for each architecture. Note that sha256_base.h is not used in the new design. It will be removed once all the architecture-specific code has been updated. Move the generic block function into its own module to avoid a circular dependency from libsha256.ko => sha256-$ARCH.ko => libsha256.ko. Signed-off-by: Eric Biggers <ebiggers@google.com> Add export and import functions to maintain existing export format. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/Makefile')
-rw-r--r--crypto/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/Makefile b/crypto/Makefile
index 587bc74b6d74..84f6911dc9ba 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -76,7 +76,8 @@ obj-$(CONFIG_CRYPTO_MD4) += md4.o
obj-$(CONFIG_CRYPTO_MD5) += md5.o
obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o
obj-$(CONFIG_CRYPTO_SHA1) += sha1_generic.o
-obj-$(CONFIG_CRYPTO_SHA256) += sha256_generic.o
+obj-$(CONFIG_CRYPTO_SHA256) += sha256.o
+CFLAGS_sha256.o += -DARCH=$(ARCH)
obj-$(CONFIG_CRYPTO_SHA512) += sha512_generic.o
obj-$(CONFIG_CRYPTO_SHA3) += sha3_generic.o
obj-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o