[PATCH] Add support for SHA384 and SHA512

Reuben Dowle reubendowle0 at gmail.com
Fri May 29 06:47:23 CEST 2020

> Two general comments.  First, please use CONFIG_IS_ENABLED() to test for
> the new symbols so that we won't have any growth in SPL if we have one
> of these enabled in the main binary but NOT SPL.

It is not clear to me how I should be using CONFIG_IS_ENABLED(). I
have copied the pattern of macro checks from the SHA256 code, and this
does not use this anywhere. Take for example common\hash.c - this is
checking for #if defined(CONFIG_SHA256) or #ifdef CONFIG_SHA256, so I
added similar checks.

It also seems that existing SHA etc algorithms are enabled in SPL
using non-standard macros like 'CONFIG_SPL_SHA1_SUPPORT' when in main
uboot the macro is CONFIG_SHA1. I tried attempting to fix these issues
- renaming CONFIG_SPL_SHA384_SUPPORT to CONFIG_SPL_SHA384, then using
the CONFIG_IS_ENABLED() macros, but I am running into a lot of
problems getting the tools (eg mkimage) to compile. In image.h there
is logic like:

#if defined(CONFIG_FIT_ENABLE_SHA256_SUPPORT) || \
#define IMAGE_ENABLE_SHA256    1
#define IMAGE_ENABLE_SHA256    0

So I think the hash algorithms are not using same method as other
parts of code to control the SPL/non SPL parts, probably because of
the interdependancy with the host tools. Fixing all this up to me
seems a separate task to just adding a new hash algorithm.

What would you advise?

More information about the U-Boot mailing list