I'm using SDK's interface for AES ECB block, but getting a hard fault when ECBDATAPTR
is redirected at ecb_data
in the initialisation function:
static uint8_t ecb_data[48]; ///< ECB data structure for RNG peripheral to access.
static uint8_t* ecb_key; ///< Key: Starts at ecb_data
static uint8_t* ecb_cleartext; ///< Cleartext: Starts at ecb_data + 16 bytes.
static uint8_t* ecb_ciphertext; ///< Ciphertext: Starts at ecb_data + 32 bytes.
bool nrf_ecb_init(void)
{
ecb_key = ecb_data;
ecb_cleartext = ecb_data + 16;
ecb_ciphertext = ecb_data + 32;
NRF_ECB->ECBDATAPTR = (uint32_t)ecb_data;
return true;
}
I've tried increasing ecb_data
size and aligning it across 4 bytes, but it doesn't help.
I'm using SDK 8.0.0. What's wrong?