aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng/randpool
diff options
context:
space:
mode:
Diffstat (limited to 'src/rng/randpool')
-rw-r--r--src/rng/randpool/randpool.cpp22
-rw-r--r--src/rng/randpool/randpool.h10
2 files changed, 20 insertions, 12 deletions
diff --git a/src/rng/randpool/randpool.cpp b/src/rng/randpool/randpool.cpp
index 9a4d77e55..c3e496638 100644
--- a/src/rng/randpool/randpool.cpp
+++ b/src/rng/randpool/randpool.cpp
@@ -15,7 +15,7 @@ namespace Botan {
namespace {
-/**
+/*
* PRF based on a MAC
*/
enum RANDPOOL_PRF_TAG {
@@ -26,7 +26,7 @@ enum RANDPOOL_PRF_TAG {
}
-/**
+/*
* Generate a buffer of random bytes
*/
void Randpool::randomize(byte out[], u32bit length)
@@ -45,7 +45,7 @@ void Randpool::randomize(byte out[], u32bit length)
}
}
-/**
+/*
* Refill the output buffer
*/
void Randpool::update_buffer()
@@ -66,7 +66,7 @@ void Randpool::update_buffer()
mix_pool();
}
-/**
+/*
* Mix the entropy pool
*/
void Randpool::mix_pool()
@@ -94,7 +94,7 @@ void Randpool::mix_pool()
update_buffer();
}
-/**
+/*
* Reseed the internal state
*/
void Randpool::reseed(u32bit poll_bits)
@@ -121,7 +121,7 @@ void Randpool::reseed(u32bit poll_bits)
seeded = true;
}
-/**
+/*
* Add user-supplied entropy
*/
void Randpool::add_entropy(const byte input[], u32bit length)
@@ -134,7 +134,7 @@ void Randpool::add_entropy(const byte input[], u32bit length)
seeded = true;
}
-/**
+/*
* Add another entropy source to the list
*/
void Randpool::add_entropy_source(EntropySource* src)
@@ -142,7 +142,7 @@ void Randpool::add_entropy_source(EntropySource* src)
entropy_sources.push_back(src);
}
-/**
+/*
* Clear memory of sensitive data
*/
void Randpool::clear()
@@ -155,7 +155,7 @@ void Randpool::clear()
seeded = false;
}
-/**
+/*
* Return the name of this type
*/
std::string Randpool::name() const
@@ -163,7 +163,7 @@ std::string Randpool::name() const
return "Randpool(" + cipher->name() + "," + mac->name() + ")";
}
-/**
+/*
* Randpool Constructor
*/
Randpool::Randpool(BlockCipher* cipher_in,
@@ -194,7 +194,7 @@ Randpool::Randpool(BlockCipher* cipher_in,
seeded = false;
}
-/**
+/*
* Randpool Destructor
*/
Randpool::~Randpool()
diff --git a/src/rng/randpool/randpool.h b/src/rng/randpool/randpool.h
index ab6ed6748..471bb791a 100644
--- a/src/rng/randpool/randpool.h
+++ b/src/rng/randpool/randpool.h
@@ -30,7 +30,15 @@ class BOTAN_DLL Randpool : public RandomNumberGenerator
void add_entropy_source(EntropySource* es);
void add_entropy(const byte input[], u32bit length);
- Randpool(BlockCipher* cipher, MessageAuthenticationCode* mac,
+ /**
+ * @param cipher a block cipher to use
+ * @param mac a message authentication code to use
+ * @param pool_blocks how many cipher blocks to use for the pool
+ * @param iterations_before_reseed how many times we'll use the
+ * internal state to generate output before reseeding
+ */
+ Randpool(BlockCipher* cipher,
+ MessageAuthenticationCode* mac,
u32bit pool_blocks = 32,
u32bit iterations_before_reseed = 128);