1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 07:21:18 +01:00

examples/psa_crypto: place input data in RAM

This commit is contained in:
Mikolai Gütschow 2025-01-17 13:38:14 +01:00
parent e8be6eec09
commit 17915037b8
No known key found for this signature in database
GPG Key ID: 943E2F37AA659AD5
2 changed files with 7 additions and 3 deletions

View File

@ -22,8 +22,10 @@
#include "psa/crypto.h"
static const uint8_t msg[] = "Hello World!";
static const size_t msg_len = sizeof(msg)-1; // exclude NULL-byte
/* certain PSA backends require the data to be in RAM rather than ROM
* so these values cannot be `const` */
static uint8_t msg[] = "Hello World!";
static size_t msg_len = sizeof(msg)-1; // exclude NULL-byte
static const uint8_t hash_sha224[] = {
0x45, 0x75, 0xbb, 0x4e, 0xc1, 0x29, 0xdf, 0x63, 0x80, 0xce, 0xdd, 0xe6, 0xd7,

View File

@ -30,7 +30,9 @@ static const uint8_t HMAC_KEY[] = {
};
static size_t HMAC_KEY_LEN = 32;
static const uint8_t HMAC_MSG[] = {
/* certain PSA backends require the data to be in RAM rather than ROM
* so these values cannot be `const` */
static uint8_t HMAC_MSG[] = {
0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x74,
0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72,