aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng/randpool/randpool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rng/randpool/randpool.cpp')
-rw-r--r--src/rng/randpool/randpool.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rng/randpool/randpool.cpp b/src/rng/randpool/randpool.cpp
index 713b5b416..bce3f8ac3 100644
--- a/src/rng/randpool/randpool.cpp
+++ b/src/rng/randpool/randpool.cpp
@@ -55,7 +55,7 @@ void Randpool::update_buffer()
break;
mac->update(static_cast<byte>(GEN_OUTPUT));
- mac->update(counter, counter.size());
+ mac->update(counter);
SecureVector<byte> mac_val = mac->final();
for(u32bit i = 0; i != mac_val.size(); ++i)
@@ -74,19 +74,19 @@ void Randpool::mix_pool()
const u32bit BLOCK_SIZE = cipher->BLOCK_SIZE;
mac->update(static_cast<byte>(MAC_KEY));
- mac->update(pool, pool.size());
+ mac->update(pool);
mac->set_key(mac->final());
mac->update(static_cast<byte>(CIPHER_KEY));
- mac->update(pool, pool.size());
+ mac->update(pool);
cipher->set_key(mac->final());
xor_buf(pool, buffer, BLOCK_SIZE);
cipher->encrypt(pool);
for(u32bit i = 1; i != POOL_BLOCKS; ++i)
{
- const byte* previous_block = pool + BLOCK_SIZE*(i-1);
- byte* this_block = pool + BLOCK_SIZE*i;
+ const byte* previous_block = &pool[BLOCK_SIZE*(i-1)];
+ byte* this_block = &pool[BLOCK_SIZE*i];
xor_buf(this_block, previous_block, BLOCK_SIZE);
cipher->encrypt(this_block);
}