aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/block/aes/aes.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/block/aes/aes.cpp b/src/block/aes/aes.cpp
index 34698ae7f..8ef9cd8fe 100644
--- a/src/block/aes/aes.cpp
+++ b/src/block/aes/aes.cpp
@@ -20,6 +20,10 @@ void AES::encrypt_n(const byte in[], byte out[], u32bit blocks) const
const u32bit* TE2 = TE + 512;
const u32bit* TE3 = TE + 768;
+ PREFETCH::readonly(TE, 1024);
+ PREFETCH::readonly(SE, 256);
+ PREFETCH::cipher_fetch(in, out, blocks, this->BLOCK_SIZE);
+
for(u32bit i = 0; i != blocks; ++i)
{
u32bit T0 = load_be<u32bit>(in, 0) ^ EK[0];
@@ -114,6 +118,10 @@ void AES::decrypt_n(const byte in[], byte out[], u32bit blocks) const
const u32bit* TD2 = TD + 512;
const u32bit* TD3 = TD + 768;
+ PREFETCH::readonly(TD, 1024);
+ PREFETCH::readonly(SD, 256);
+ PREFETCH::cipher_fetch(in, out, blocks, this->BLOCK_SIZE);
+
for(u32bit i = 0; i != blocks; ++i)
{
u32bit T0 = load_be<u32bit>(in, 0) ^ DK[0];