aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-17 05:44:33 +0000
committerlloyd <[email protected]>2009-11-17 05:44:33 +0000
commitc12e0e4f45497f8ecb628ba7d753f87aa8db0813 (patch)
tree5f2d3c4efd7efe0ac99366a84ebd50a062e15503 /src/rng
parent435965ac3b199d31b799ebefc012d928bc415621 (diff)
parent0d27bc0f8763cb6dd6307dbab7713058dee18b2c (diff)
propagate from branch 'net.randombit.botan' (head cfb19182987fc95b2a8885584a38edb10b4709b3)
to branch 'net.randombit.botan.c++0x' (head 1570877c463fed4b632bc49a5b5ee27c57de2cb5)
Diffstat (limited to 'src/rng')
-rw-r--r--src/rng/hmac_rng/hmac_rng.cpp2
-rw-r--r--src/rng/randpool/randpool.cpp6
-rw-r--r--src/rng/x931_rng/x931_rng.cpp6
3 files changed, 7 insertions, 7 deletions
diff --git a/src/rng/hmac_rng/hmac_rng.cpp b/src/rng/hmac_rng/hmac_rng.cpp
index 213373657..b43e6d9c2 100644
--- a/src/rng/hmac_rng/hmac_rng.cpp
+++ b/src/rng/hmac_rng/hmac_rng.cpp
@@ -171,7 +171,7 @@ HMAC_RNG::HMAC_RNG(MessageAuthenticationCode* extractor_mac,
extractor(extractor_mac), prf(prf_mac)
{
// First PRF inputs are all zero, as specified in section 2
- K.create(prf->OUTPUT_LENGTH);
+ K.resize(prf->OUTPUT_LENGTH);
counter = 0;
seeded = false;
diff --git a/src/rng/randpool/randpool.cpp b/src/rng/randpool/randpool.cpp
index b04da7358..f4ce84079 100644
--- a/src/rng/randpool/randpool.cpp
+++ b/src/rng/randpool/randpool.cpp
@@ -193,9 +193,9 @@ Randpool::Randpool(BlockCipher* cipher_in,
cipher->name() + "/" + mac->name());
}
- buffer.create(BLOCK_SIZE);
- pool.create(POOL_BLOCKS * BLOCK_SIZE);
- counter.create(12);
+ buffer.resize(BLOCK_SIZE);
+ pool.resize(POOL_BLOCKS * BLOCK_SIZE);
+ counter.resize(12);
seeded = false;
}
diff --git a/src/rng/x931_rng/x931_rng.cpp b/src/rng/x931_rng/x931_rng.cpp
index 64d57ac1c..bd66d22bf 100644
--- a/src/rng/x931_rng/x931_rng.cpp
+++ b/src/rng/x931_rng/x931_rng.cpp
@@ -64,7 +64,7 @@ void ANSI_X931_RNG::rekey()
cipher->set_key(key, key.size());
if(V.size() != cipher->BLOCK_SIZE)
- V.create(cipher->BLOCK_SIZE);
+ V.resize(cipher->BLOCK_SIZE);
prng->randomize(V, V.size());
update_buffer();
@@ -102,7 +102,7 @@ void ANSI_X931_RNG::add_entropy(const byte input[], u32bit length)
*/
bool ANSI_X931_RNG::is_seeded() const
{
- return V.has_items();
+ return (V.size() > 0);
}
/**
@@ -138,7 +138,7 @@ ANSI_X931_RNG::ANSI_X931_RNG(BlockCipher* cipher_in,
cipher = cipher_in;
prng = prng_in;
- R.create(cipher->BLOCK_SIZE);
+ R.resize(cipher->BLOCK_SIZE);
position = 0;
}