Skip to content

Commit

Permalink
samples: drivers: crypto: Improve memory alignment
Browse files Browse the repository at this point in the history
Commit e1e1973 (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 <[email protected]>
  • Loading branch information
rettichschnidi committed Oct 3, 2024
1 parent 44d101a commit 1abc5e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/drivers/crypto/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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
};
Expand Down

0 comments on commit 1abc5e2

Please sign in to comment.