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/lion/lion.cpp | |
parent | 27d79c87365105d6128afe9eaf8a82383976ed44 (diff) |
First set of changes for avoiding use implicit vector->pointer conversions
Diffstat (limited to 'src/block/lion/lion.cpp')
-rw-r--r-- | src/block/lion/lion.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/block/lion/lion.cpp b/src/block/lion/lion.cpp index 45e051ada..9d0dff297 100644 --- a/src/block/lion/lion.cpp +++ b/src/block/lion/lion.cpp @@ -16,11 +16,12 @@ namespace Botan { */ void Lion::encrypt_n(const byte in[], byte out[], u32bit blocks) const { - SecureVector<byte> buffer(LEFT_SIZE); + SecureVector<byte> buffer_vec(LEFT_SIZE); + byte* buffer = &buffer_vec[0]; for(u32bit i = 0; i != blocks; ++i) { - xor_buf(buffer, in, key1, LEFT_SIZE); + xor_buf(buffer, in, &key1[0], LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); cipher->cipher(in + LEFT_SIZE, out + LEFT_SIZE, RIGHT_SIZE); @@ -28,7 +29,7 @@ void Lion::encrypt_n(const byte in[], byte out[], u32bit blocks) const hash->final(buffer); xor_buf(out, in, buffer, LEFT_SIZE); - xor_buf(buffer, out, key2, LEFT_SIZE); + xor_buf(buffer, out, &key2[0], LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); cipher->cipher1(out + LEFT_SIZE, RIGHT_SIZE); @@ -42,11 +43,12 @@ void Lion::encrypt_n(const byte in[], byte out[], u32bit blocks) const */ void Lion::decrypt_n(const byte in[], byte out[], u32bit blocks) const { - SecureVector<byte> buffer(LEFT_SIZE); + SecureVector<byte> buffer_vec(LEFT_SIZE); + byte* buffer = &buffer_vec[0]; for(u32bit i = 0; i != blocks; ++i) { - xor_buf(buffer, in, key2, LEFT_SIZE); + xor_buf(buffer, in, &key2[0], LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); cipher->cipher(in + LEFT_SIZE, out + LEFT_SIZE, RIGHT_SIZE); @@ -54,7 +56,7 @@ void Lion::decrypt_n(const byte in[], byte out[], u32bit blocks) const hash->final(buffer); xor_buf(out, in, buffer, LEFT_SIZE); - xor_buf(buffer, out, key1, LEFT_SIZE); + xor_buf(buffer, out, &key1[0], LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); cipher->cipher1(out + LEFT_SIZE, RIGHT_SIZE); |