This serie adds the support of sha256_hmac and sha256_hkdf. A first version was sent several months ago just before the integration of mbedtls. This new version is based on mbedtls.
The first patch of this serie add the support of hkdf using mbedtls. v4: - fix computation of the hmac - add more test for hmac - move sha256 common functions to sha256_common.c - some cleanup v3: - also define sha256_hmac for legacy sha256 - add some #if to define function only when needed Philippe Reynes (8): tools: kwbimage.h: use linux/compiler_attributes.h tools: renesas_spkgimage.h: use linux/compiler_attributes.h mbedtls: enable support of hkdf lib: sha256: move common function to sha256_common.c lib: sha256: add feature sha256_hmac test: lib: add test for sha256_hmac lib: mbedtls: sha256: add support of key derivation test: lib: add test for key derivation include/u-boot/sha256.h | 24 +++ lib/Makefile | 1 + lib/mbedtls/Kconfig | 14 ++ lib/mbedtls/Makefile | 2 + lib/mbedtls/mbedtls_def_config.h | 4 + lib/mbedtls/sha256.c | 43 ++--- lib/sha256.c | 36 ---- lib/sha256_common.c | 98 ++++++++++ test/lib/Makefile | 2 + test/lib/test_sha256_hkdf.c | 107 +++++++++++ test/lib/test_sha256_hmac.c | 296 +++++++++++++++++++++++++++++++ tools/Makefile | 1 + tools/kwbimage.h | 6 +- tools/renesas_spkgimage.h | 6 +- 14 files changed, 570 insertions(+), 70 deletions(-) create mode 100644 lib/sha256_common.c create mode 100644 test/lib/test_sha256_hkdf.c create mode 100644 test/lib/test_sha256_hmac.c -- 2.25.1