fix(util): Fix unaligned access to the flash if some LUT is type of "uint8_t" or "uint16_t"

Make the "uint8_t" or "uint16_t" LTU 4-byte-align.
This commit is contained in:
dongheng
2019-05-05 20:09:56 +08:00
parent ff208010f4
commit 0fa41f1fb9
3 changed files with 10 additions and 4 deletions

View File

@@ -92,7 +92,7 @@
/*
* Forward S-box
*/
static const uint8_t s_aes_fsb[256] __attribute__((aligned(4))) =
static const uint8_t s_aes_fsb[256] ESP_IBUS_ATTR =
{
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5,
0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
@@ -219,7 +219,7 @@ static const uint32_t s_aes_ft3[256] = { FT };
/*
* Reverse S-box
*/
static const uint8_t s_aes_rsb[256] __attribute__((aligned(4))) =
static const uint8_t s_aes_rsb[256] ESP_IBUS_ATTR =
{
0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38,
0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,