Skip to content

Commit bc8fd2c

Browse files
committed
zephyr: Support for HKDF/HMAC with SHA512
The commit addds CONFIG_BOOT_HMAC_SHA512 that enables MCUboot configuration option MCUBOOT_HMAC_SHA512, that is used for switching HKDF/HMAC in ECIES key exchange to SHA512, from default SHA256. This option, currently, is only available for ECIES-X25519 with PSA as crypto backend. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 4cb9207 commit bc8fd2c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

boot/zephyr/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,15 @@ config BOOT_ENCRYPT_X25519
601601
help
602602
Hidden option selecting x25519 encryption.
603603

604+
config BOOT_HMAC_SHA512
605+
bool "Use SHA512 for HMAC/HKDF"
606+
depends on BOOT_ENCRYPT_X25519
607+
depends on BOOT_USE_PSA_CRYPTO
608+
help
609+
By default SHA256 is used for HKDF/HMAC in key exchange expansion
610+
and verification. This options switches to SHA512. The option is
611+
mainly useful to reduce numer of compiled in SHA algorithms.
612+
604613
config BOOT_ENCRYPTION_KEY_FILE
605614
string "Encryption key file"
606615
depends on BOOT_ENCRYPT_IMAGE

boot/zephyr/include/mcuboot_config/mcuboot_config.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@
153153
#define MCUBOOT_ENCRYPT_X25519
154154
#endif
155155

156+
/* Support for HMAC/HKDF using SHA512; this is used in key exchange where
157+
* HKDF is used for key expansion and HMAC is used for key verification.
158+
*/
159+
#ifdef CONFIG_BOOT_HMAC_SHA512
160+
#define MCUBOOT_HMAC_SHA512
161+
#endif
162+
156163
#ifdef CONFIG_BOOT_DECOMPRESSION
157164
#define MCUBOOT_DECOMPRESS_IMAGES
158165
#endif

0 commit comments

Comments
 (0)