From 6ae1a14c9f24754cccfb5c0cd84851f9b6650375 Mon Sep 17 00:00:00 2001 From: toddouska Date: Mon, 12 Sep 2016 21:09:08 -0700 Subject: [PATCH] do aes cache line stride by bytes, not word32s --- wolfcrypt/src/aes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 65a5538ce..bfd46ffde 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -1260,7 +1260,8 @@ static INLINE word32 PreFetchTe(void) int i,j; for (i = 0; i < 4; i++) { - for (j = 0; j < 256; j += WC_CACHE_LINE_SZ) { + /* 256 elements, each one is 4 bytes */ + for (j = 0; j < 256; j += WC_CACHE_LINE_SZ/4) { x &= Te[i][j]; } } @@ -1461,7 +1462,8 @@ static INLINE word32 PreFetchTd(void) int i,j; for (i = 0; i < 4; i++) { - for (j = 0; j < 256; j += WC_CACHE_LINE_SZ) { + /* 256 elements, each one is 4 bytes */ + for (j = 0; j < 256; j += WC_CACHE_LINE_SZ/4) { x &= Td[i][j]; } }