From 3fc84bf686431ea9330212702a576787c8226648 Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Thu, 2 Apr 2020 10:29:41 -0300 Subject: [PATCH] keys: Add sample x25519 priv/pub keys Signed-off-by: Fabio Utzig --- enc-x25519-priv.pem | 3 +++ enc-x25519-pub.pem | 3 +++ sim/mcuboot-sys/csupport/keys.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 enc-x25519-priv.pem create mode 100644 enc-x25519-pub.pem diff --git a/enc-x25519-priv.pem b/enc-x25519-priv.pem new file mode 100644 index 00000000..cb92491d --- /dev/null +++ b/enc-x25519-priv.pem @@ -0,0 +1,3 @@ +-----BEGIN PRIVATE KEY----- +MC4CAQAwBQYDK2VuBCIEICiAL+/vgpVQ8UGTA2wbuUlsUeUmh493B/i0HwRFbYRP +-----END PRIVATE KEY----- diff --git a/enc-x25519-pub.pem b/enc-x25519-pub.pem new file mode 100644 index 00000000..80d89a64 --- /dev/null +++ b/enc-x25519-pub.pem @@ -0,0 +1,3 @@ +-----BEGIN PUBLIC KEY----- +MCowBQYDK2VuAyEApnrfU1lvc6n45HmsC6ogwvmJkv+Wltehx3CxYYsqD3A= +-----END PUBLIC KEY----- diff --git a/sim/mcuboot-sys/csupport/keys.c b/sim/mcuboot-sys/csupport/keys.c index 58b425d1..80116293 100644 --- a/sim/mcuboot-sys/csupport/keys.c +++ b/sim/mcuboot-sys/csupport/keys.c @@ -283,3 +283,17 @@ const struct bootutil_key bootutil_enc_key = { .len = &enc_key_len, }; #endif + +#if defined(MCUBOOT_ENCRYPT_X25519) +unsigned char enc_key[] = { + 0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, + 0x04, 0x22, 0x04, 0x20, 0x28, 0x80, 0x2f, 0xef, 0xef, 0x82, 0x95, 0x50, + 0xf1, 0x41, 0x93, 0x03, 0x6c, 0x1b, 0xb9, 0x49, 0x6c, 0x51, 0xe5, 0x26, + 0x87, 0x8f, 0x77, 0x07, 0xf8, 0xb4, 0x1f, 0x04, 0x45, 0x6d, 0x84, 0x4f, +}; +static unsigned int enc_key_len = 48; +const struct bootutil_key bootutil_enc_key = { + .key = enc_key, + .len = &enc_key_len, +}; +#endif