aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/lubyrack
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-14 02:27:02 +0000
committerlloyd <[email protected]>2010-09-14 02:27:02 +0000
commitd472ea829a530fd6995293904d4f07a7ef8b5472 (patch)
tree3b1fd3913aa1b223444753cb39e973d5753f3b4b /src/block/lubyrack
parent77a33b0c16880884cc0326e92c0c30d0e8444a91 (diff)
Remove more implicit vector to pointer conversions
Diffstat (limited to 'src/block/lubyrack')
-rw-r--r--src/block/lubyrack/lubyrack.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/block/lubyrack/lubyrack.cpp b/src/block/lubyrack/lubyrack.cpp
index 99f8e6da1..cdaff1b1e 100644
--- a/src/block/lubyrack/lubyrack.cpp
+++ b/src/block/lubyrack/lubyrack.cpp
@@ -17,28 +17,29 @@ void LubyRackoff::encrypt_n(const byte in[], byte out[], u32bit blocks) const
{
const u32bit len = hash->OUTPUT_LENGTH;
- SecureVector<byte> buffer(len);
+ SecureVector<byte> buffer_vec(len);
+ byte* buffer = &buffer_vec[0];
for(u32bit i = 0; i != blocks; ++i)
{
hash->update(K1);
hash->update(in, len);
- hash->final(&buffer[0]);
+ hash->final(buffer);
xor_buf(out + len, in + len, buffer, len);
hash->update(K2);
hash->update(out + len, len);
- hash->final(&buffer[0]);
+ hash->final(buffer);
xor_buf(out, in, buffer, len);
hash->update(K1);
hash->update(out, len);
- hash->final(&buffer[0]);
+ hash->final(buffer);
xor_buf(out + len, buffer, len);
hash->update(K2);
hash->update(out + len, len);
- hash->final(&buffer[0]);
+ hash->final(buffer);
xor_buf(out, buffer, len);
in += BLOCK_SIZE;
@@ -53,28 +54,29 @@ void LubyRackoff::decrypt_n(const byte in[], byte out[], u32bit blocks) const
{
const u32bit len = hash->OUTPUT_LENGTH;
- SecureVector<byte> buffer(len);
+ SecureVector<byte> buffer_vec(len);
+ byte* buffer = &buffer_vec[0];
for(u32bit i = 0; i != blocks; ++i)
{
hash->update(K2);
hash->update(in + len, len);
- hash->final(&buffer[0]);
+ hash->final(buffer);
xor_buf(out, in, buffer, len);
hash->update(K1);
hash->update(out, len);
- hash->final(&buffer[0]);
+ hash->final(buffer);
xor_buf(out + len, in + len, buffer, len);
hash->update(K2);
hash->update(out + len, len);
- hash->final(&buffer[0]);
+ hash->final(buffer);
xor_buf(out, buffer, len);
hash->update(K1);
hash->update(out, len);
- hash->final(&buffer[0]);
+ hash->final(buffer);
xor_buf(out + len, buffer, len);
in += BLOCK_SIZE;