From 83345401d680c8fca6050d9dbbbe97771b825e1f Mon Sep 17 00:00:00 2001 From: Reto Schneider Date: Thu, 3 Oct 2024 19:26:45 +0200 Subject: [PATCH] samples: drivers: crypto: Improve memory alignment Commit e1e19732bcdd00b55c5a7987580011eae0b640ee (samples: drivers: crypto: Aligned AES key) introduced the alignment for the key. According to the commit message, the intention was to align the variable at 32 bit boundaries. For this reason, passing 32 to __aligned seems like an error, as its argument is denoted in byte and not bits. Signed-off-by: Reto Schneider --- samples/drivers/crypto/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/drivers/crypto/src/main.c b/samples/drivers/crypto/src/main.c index ef0d248c365..ac031e88672 100644 --- a/samples/drivers/crypto/src/main.c +++ b/samples/drivers/crypto/src/main.c @@ -37,7 +37,7 @@ LOG_MODULE_REGISTER(main); #error "You need to enable one crypto device" #endif -const static uint8_t key[16] __aligned(32) = { +const static uint8_t key[16] __aligned(4) = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c };