aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng
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/rng
parent77a33b0c16880884cc0326e92c0c30d0e8444a91 (diff)
Remove more implicit vector to pointer conversions
Diffstat (limited to 'src/rng')
-rw-r--r--src/rng/x931_rng/x931_rng.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rng/x931_rng/x931_rng.cpp b/src/rng/x931_rng/x931_rng.cpp
index ddb7c138c..1d5e57f6e 100644
--- a/src/rng/x931_rng/x931_rng.cpp
+++ b/src/rng/x931_rng/x931_rng.cpp
@@ -41,10 +41,10 @@ void ANSI_X931_RNG::update_buffer()
SecureVector<byte> DT = prng->random_vec(cipher->BLOCK_SIZE);
cipher->encrypt(DT);
- xor_buf(R, V, DT, cipher->BLOCK_SIZE);
+ xor_buf(&R[0], &V[0], &DT[0], cipher->BLOCK_SIZE);
cipher->encrypt(R);
- xor_buf(V, R, DT, cipher->BLOCK_SIZE);
+ xor_buf(&V[0], &R[0], &DT[0], cipher->BLOCK_SIZE);
cipher->encrypt(V);
position = 0;
@@ -57,13 +57,11 @@ void ANSI_X931_RNG::rekey()
{
if(prng->is_seeded())
{
- SecureVector<byte> key(cipher->MAXIMUM_KEYLENGTH);
- prng->randomize(key, key.size());
- cipher->set_key(key, key.size());
+ cipher->set_key(prng->random_vec(cipher->MAXIMUM_KEYLENGTH));
if(V.size() != cipher->BLOCK_SIZE)
V.resize(cipher->BLOCK_SIZE);
- prng->randomize(V, V.size());
+ prng->randomize(&V[0], V.size());
update_buffer();
}