]> git.dujemihanovic.xyz Git - u-boot.git/commit
lib: Adapt digest header files to MbedTLS
authorRaymond Mao <raymond.mao@linaro.org>
Thu, 3 Oct 2024 21:50:16 +0000 (14:50 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 14 Oct 2024 23:58:23 +0000 (17:58 -0600)
commit5d1d98399f71a73c1353ed2384293ca14a2d086c
tree66bc6e842f74acb2d05ba6220fe70825f3e77802
parent13de8483388c8ca2feed74de229540b0b3822025
lib: Adapt digest header files to MbedTLS

Adapt digest header files to support both original libs and MbedTLS
by switching on/off MBEDTLS_LIB_CRYPTO.
Introduce <alg>_LEGACY kconfig for legacy hash implementations.
sha256.o should depend on SHA256 kconfig only but not SUPPORT_EMMC_RPMB,
SHA256 should be selected when SUPPORT_EMMC_RPMB is enabled instead.

`IS_ENABLED` or `CONFIG_IS_ENABLED` is not applicable here, since
including <linux/kconfig.h> causes undefined reference on schedule()
with sandbox build, as <linux/kconfig.h> includes <generated/autoconf.h>
which enables `CONFIG_HW_WATCHDOG` and `CONFIG_WATCHDOG` but no schedule()
are defined in sandbox build,
Thus we use `#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)` instead.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
drivers/mmc/Kconfig
include/u-boot/md5.h
include/u-boot/sha1.h
include/u-boot/sha256.h
include/u-boot/sha512.h
lib/Makefile
lib/mbedtls/Kconfig