[PATCH v6 08/28] mbedtls: Enable smaller implementation for SHA256/512

Tom Rini trini at konsulko.com
Mon Aug 19 23:03:15 CEST 2024


On Fri, Aug 16, 2024 at 02:43:57PM -0700, Raymond Mao wrote:

> Smaller implementation for SHA256 and SHA512 helps to reduce the
> ROM footprint though it has a certain impact on performance.
> As a trade-off, enable it as a default config when MbedTLS is
> enabled can reduce the target size significantly with acceptable
> performace loss.
> 
> Signed-off-by: Raymond Mao <raymond.mao at linaro.org>
> ---
> Changes in v6
> - Initial patch
> 
>  lib/mbedtls/Kconfig              | 24 ++++++++++++++++++++++++
>  lib/mbedtls/mbedtls_def_config.h |  6 ++++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/lib/mbedtls/Kconfig b/lib/mbedtls/Kconfig
> index 12f8c965f5a..0e22edf1b6c 100644
> --- a/lib/mbedtls/Kconfig
> +++ b/lib/mbedtls/Kconfig
> @@ -151,18 +151,42 @@ config SHA1_MBEDTLS
>  config SHA256_MBEDTLS
>  	bool "Enable SHA256 support with MbedTLS crypto library"
>  	depends on MBEDTLS_LIB_CRYPTO && SHA256
> +	select SHA256_SMALLER
>  	help
>  	  This option enables support of hashing using SHA256 algorithm
>  	  with MbedTLS crypto library.
>  
> +if SHA256_MBEDTLS
> +
> +config SHA256_SMALLER
> +	bool "Enable SHA256 smaller implementation with MbedTLS crypto library"
> +	depends on SHA256_MBEDTLS
> +	help
> +	  This option enables support of hashing using SHA256 algorithm
> +	  smaller implementation with MbedTLS crypto library.
> +
> +endif

For each of these, they shouldn't be select'd, they just need to depends
on the right option (SHA256_MBEDTLS, etc) and be default y.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240819/3ef65f1b/attachment.sig>


More information about the U-Boot mailing list