diff options
author | lloyd <[email protected]> | 2010-09-13 15:21:31 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-13 15:21:31 +0000 |
commit | 4a7e9edcc92b08a285ea24549fd8c813d10b63b9 (patch) | |
tree | 569e357cbc1bd2b195c1b10b281f6c0bbf01fd33 /src/block/serpent_simd | |
parent | 27d79c87365105d6128afe9eaf8a82383976ed44 (diff) |
First set of changes for avoiding use implicit vector->pointer conversions
Diffstat (limited to 'src/block/serpent_simd')
-rw-r--r-- | src/block/serpent_simd/serp_simd.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/block/serpent_simd/serp_simd.cpp b/src/block/serpent_simd/serp_simd.cpp index c64514de1..a4143804a 100644 --- a/src/block/serpent_simd/serp_simd.cpp +++ b/src/block/serpent_simd/serp_simd.cpp @@ -180,9 +180,11 @@ void serpent_decrypt_4(const byte in[64], */ void Serpent_SIMD::encrypt_n(const byte in[], byte out[], u32bit blocks) const { + const u32bit* KS = &(this->get_round_keys()[0]); + while(blocks >= 4) { - serpent_encrypt_4(in, out, this->get_round_keys()); + serpent_encrypt_4(in, out, KS); in += 4 * BLOCK_SIZE; out += 4 * BLOCK_SIZE; blocks -= 4; @@ -197,9 +199,11 @@ void Serpent_SIMD::encrypt_n(const byte in[], byte out[], u32bit blocks) const */ void Serpent_SIMD::decrypt_n(const byte in[], byte out[], u32bit blocks) const { + const u32bit* KS = &(this->get_round_keys()[0]); + while(blocks >= 4) { - serpent_decrypt_4(in, out, this->get_round_keys()); + serpent_decrypt_4(in, out, KS); in += 4 * BLOCK_SIZE; out += 4 * BLOCK_SIZE; blocks -= 4; |