From feb6c4cd409b9930561516da4dd80615f6710a3e Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Thu, 2 Apr 2020 10:28:39 -0300 Subject: [PATCH] caps: Add cap for x25519 based image encryption Signed-off-by: Fabio Utzig --- boot/bootutil/include/bootutil/caps.h | 1 + boot/bootutil/src/caps.c | 3 +++ sim/src/caps.rs | 1 + 3 files changed, 5 insertions(+) diff --git a/boot/bootutil/include/bootutil/caps.h b/boot/bootutil/include/bootutil/caps.h index 3205fa21..6f3806ea 100644 --- a/boot/bootutil/include/bootutil/caps.h +++ b/boot/bootutil/include/bootutil/caps.h @@ -45,6 +45,7 @@ uint32_t bootutil_get_caps(void); #define BOOTUTIL_CAP_ENC_EC256 (1<<10) #define BOOTUTIL_CAP_SWAP_USING_MOVE (1<<11) #define BOOTUTIL_CAP_DOWNGRADE_PREVENTION (1<<12) +#define BOOTUTIL_CAP_ENC_X25519 (1<<13) /* * Query the number of images this bootloader is configured for. This diff --git a/boot/bootutil/src/caps.c b/boot/bootutil/src/caps.c index c15ecb55..a59a01d1 100644 --- a/boot/bootutil/src/caps.c +++ b/boot/bootutil/src/caps.c @@ -54,6 +54,9 @@ uint32_t bootutil_get_caps(void) #if defined(MCUBOOT_ENCRYPT_EC256) res |= BOOTUTIL_CAP_ENC_EC256; #endif +#if defined(MCUBOOT_ENCRYPT_X25519) + res |= BOOTUTIL_CAP_ENC_X25519; +#endif #if defined(MCUBOOT_VALIDATE_PRIMARY_SLOT) res |= BOOTUTIL_CAP_VALIDATE_PRIMARY_SLOT; #endif diff --git a/sim/src/caps.rs b/sim/src/caps.rs index f823b99d..edffd0c6 100644 --- a/sim/src/caps.rs +++ b/sim/src/caps.rs @@ -23,6 +23,7 @@ pub enum Caps { EncEc256 = (1 << 10), SwapUsingMove = (1 << 11), DowngradePrevention = (1 << 12), + EncX25519 = (1 << 13), } impl Caps {