This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Generate Keys with nrfutil

Hi,

Our device is based on nRF52840 + SDK 15.0.0 and we use cc310 backend for crypto tasks

Messages and SW packages are signed by Ecdsa.

I installed nrfutil and try to generate paired keys (see below for the keys).

I tried to test the key by embedded them in ecdsa example  (..\nRF5_SDK_15.0.0_a53641a\examples\crypto\nrf_crypto\ecdsa)

It failed with internal error (34070) at line 127  in cc310_backend_ecc.c

crys_error = CRYS_ECPKI_BuildPublKeyFullCheck(p_domain,
ucompressed_key,
p_info->raw_public_key_size + 1,
&p_pub->key.cc310_public_key,
p_temp_data);

Any suggestion for solving this issue?

The following keys were generated and hard coded into main.c (example original keys were commented out):

Private

// 550b4ec77284f0538eae285a6d949a3ba8b8ca6bc3b2cbffcf0e8a6cc197db91

/** @brief Predefined example private key.
*
* This private key contains some dummy data just to show the functionality. Is should never be
* placed in any practical usage. Is is not secure, because it is filled with ones (in HEX).
*/
static const uint8_t m_alice_raw_private_key[] =
/*
{
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, // This is an example. DO NOT USE THIS KEY!
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, // This is an example. DO NOT USE THIS KEY!
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, // This is an example. DO NOT USE THIS KEY!
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, // This is an example. DO NOT USE THIS KEY!
};
*/
{
0x55, 0x0b, 0x4e, 0xc7, 0x72, 0x84, 0xf0, 0x53,

0x8e, 0xae, 0x28, 0x5a, 0x6d, 0x94, 0x9a, 0x3b,

0xa8, 0xb8, 0xca, 0x6b, 0xc3, 0xb2, 0xcb, 0xff,

0xcf, 0x0e, 0x8a, 0x6c, 0xc1, 0x97, 0xdb, 0x91
};

 

Public

 

/** @brief Predefined example public key that is associated with example private key
* @ref m_alice_raw_private_key.
*/
static const uint8_t m_alice_raw_public_key[] =
/*
{
0x02, 0x17, 0xE6, 0x17, 0xF0, 0xB6, 0x44, 0x39,
0x28, 0x27, 0x8F, 0x96, 0x99, 0x9E, 0x69, 0xA2,
0x3A, 0x4F, 0x2C, 0x15, 0x2B, 0xDF, 0x6D, 0x6C,
0xDF, 0x66, 0xE5, 0xB8, 0x02, 0x82, 0xD4, 0xED,
0x19, 0x4A, 0x7D, 0xEB, 0xCB, 0x97, 0x71, 0x2D,
0x2D, 0xDA, 0x3C, 0xA8, 0x5A, 0xA8, 0x76, 0x5A,
0x56, 0xF4, 0x5F, 0xC7, 0x58, 0x59, 0x96, 0x52,
0xF2, 0x89, 0x7C, 0x65, 0x30, 0x6E, 0x57, 0x94,
};
*/
{
0x91, 0x4f, 0x70, 0x0b, 0x68, 0x6e, 0xe7, 0xd0, 0xad, 0xdb, 0xce, 0xef, 0xf5
, 0x6f, 0xb2, 0x8e, 0xe6, 0x25, 0xbc, 0x2c, 0x83, 0xb1, 0x85, 0x50, 0xbf, 0x5c,
0xdc, 0xa4, 0x7e, 0x6b, 0x28, 0x44,
0xfd, 0x43, 0xec, 0x21, 0x48, 0xf4, 0x03, 0x90, 0xcb, 0x29, 0xe9, 0x4d, 0x5a
, 0x68, 0xeb, 0xf8, 0xab, 0xbc, 0x52, 0x86, 0x61, 0x95, 0xcb, 0x1b, 0xea, 0xeb,
0x3f, 0x81, 0xa6, 0x6e, 0x95, 0xfd,
};

Related