diff options
author | lloyd <[email protected]> | 2009-09-30 01:29:06 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-09-30 01:29:06 +0000 |
commit | 59b4eb0bd2d1b9d65c3921f5205a012f1a98fdf8 (patch) | |
tree | de09a13123c73df9259031e76daae57a091ab43b /src | |
parent | 90180351e7370d0b6b93c2a69a5298bd4805ac83 (diff) |
Disable prefetch in AES for now. Problem: with iterative modes like CBC,
the prefetch is called for each block of input, and so a total of
(4096+256)/64 = 68 prefetches are executed for each block. This reduces
performance of iterative modes dramatically.
I'm not sure what the right approach for dealing with this is.
Diffstat (limited to 'src')
-rw-r--r-- | src/block/aes/aes.cpp | 8 | ||||
-rw-r--r-- | src/utils/prefetch.h | 12 |
2 files changed, 0 insertions, 20 deletions
diff --git a/src/block/aes/aes.cpp b/src/block/aes/aes.cpp index 8ef9cd8fe..34698ae7f 100644 --- a/src/block/aes/aes.cpp +++ b/src/block/aes/aes.cpp @@ -20,10 +20,6 @@ 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]; @@ -118,10 +114,6 @@ 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]; diff --git a/src/utils/prefetch.h b/src/utils/prefetch.h index 72b6de689..7afdbda0a 100644 --- a/src/utils/prefetch.h +++ b/src/utils/prefetch.h @@ -36,18 +36,6 @@ inline void readwrite(const T* addr, u32bit length) #endif } -inline void cipher_fetch(const byte* in_block, - const byte* out_block, - u32bit blocks, - u32bit block_size) - { - // Only prefetch input specifically if in != out - if(in_block != out_block) - readonly(in_block, blocks * block_size); - - readwrite(out_block, blocks * block_size); - } - } } |