aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng/rng.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/rng/rng.cpp')
-rw-r--r--src/lib/rng/rng.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/rng/rng.cpp b/src/lib/rng/rng.cpp
index d4fd5fb10..c17f23dd0 100644
--- a/src/lib/rng/rng.cpp
+++ b/src/lib/rng/rng.cpp
@@ -7,9 +7,24 @@
#include <botan/rng.h>
#include <botan/hmac_rng.h>
+#include <botan/entropy_src.h>
namespace Botan {
+size_t RandomNumberGenerator::reseed(size_t bits_to_collect)
+ {
+ return this->reseed_with_timeout(bits_to_collect,
+ BOTAN_RNG_RESEED_DEFAULT_TIMEOUT);
+ }
+
+size_t RandomNumberGenerator::reseed_with_timeout(size_t bits_to_collect,
+ std::chrono::milliseconds timeout)
+ {
+ return this->reseed_with_sources(Entropy_Sources::global_sources(),
+ bits_to_collect,
+ timeout);
+ }
+
RandomNumberGenerator* RandomNumberGenerator::make_rng()
{
std::unique_ptr<MessageAuthenticationCode> h1(MessageAuthenticationCode::create("HMAC(SHA-512)"));