From d472ea829a530fd6995293904d4f07a7ef8b5472 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 14 Sep 2010 02:27:02 +0000 Subject: Remove more implicit vector to pointer conversions --- src/rng/x931_rng/x931_rng.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/rng') 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 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 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(); } -- cgit v1.2.3