aes.c: use uint8_t for array of pow and log to save RAM
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
717a83164e
commit
5c86b1775a
1 changed files with 4 additions and 4 deletions
|
@ -365,15 +365,15 @@ static int aes_init_done = 0;
|
||||||
static void aes_gen_tables(void)
|
static void aes_gen_tables(void)
|
||||||
{
|
{
|
||||||
int i, x, y, z;
|
int i, x, y, z;
|
||||||
int pow[256];
|
uint8_t pow[256];
|
||||||
int log[256];
|
uint8_t log[256];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* compute pow and log tables over GF(2^8)
|
* compute pow and log tables over GF(2^8)
|
||||||
*/
|
*/
|
||||||
for (i = 0, x = 1; i < 256; i++) {
|
for (i = 0, x = 1; i < 256; i++) {
|
||||||
pow[i] = x;
|
pow[i] = (uint8_t) x;
|
||||||
log[x] = i;
|
log[x] = (uint8_t) i;
|
||||||
x = MBEDTLS_BYTE_0(x ^ XTIME(x));
|
x = MBEDTLS_BYTE_0(x ^ XTIME(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue