Add bootutil support for ed25519 validation
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/boot/bootutil/src/image_validate.c b/boot/bootutil/src/image_validate.c
index 6597a81..9cff0ac 100644
--- a/boot/bootutil/src/image_validate.c
+++ b/boot/bootutil/src/image_validate.c
@@ -123,9 +123,10 @@
* call. List the type of TLV we are expecting. If we aren't
* configured for any signature, don't define this macro.
*/
-#if (defined(MCUBOOT_SIGN_RSA) + \
- defined(MCUBOOT_SIGN_EC) + \
- defined(MCUBOOT_SIGN_EC256)) > 1
+#if (defined(MCUBOOT_SIGN_RSA) + \
+ defined(MCUBOOT_SIGN_EC) + \
+ defined(MCUBOOT_SIGN_EC256) + \
+ defined(MCUBOOT_SIGN_ED25519)) > 1
#error "Only a single signature type is supported!"
#endif
@@ -147,6 +148,10 @@
# define EXPECTED_SIG_TLV IMAGE_TLV_ECDSA256
# define SIG_BUF_SIZE 128
# define EXPECTED_SIG_LEN(x) ((x) >= 72) /* oids + 2 * 32 bytes */
+#elif defined(MCUBOOT_SIGN_ED25519)
+# define EXPECTED_SIG_TLV IMAGE_TLV_ED25519
+# define SIG_BUF_SIZE 64
+# define EXPECTED_SIG_LEN(x) ((x) == SIG_BUF_SIZE)
#else
# define SIG_BUF_SIZE 32 /* no signing, sha256 digest only */
#endif