Botan 3.7.1
Crypto and TLS for C&
|
#include <entropy_src.h>
Public Member Functions | |
void | add_source (std::unique_ptr< Entropy_Source > src) |
std::vector< std::string > | enabled_sources () const |
Entropy_Sources ()=default | |
Entropy_Sources (const Entropy_Sources &other)=delete | |
Entropy_Sources (const std::vector< std::string > &sources) | |
Entropy_Sources (Entropy_Sources &&other)=delete | |
Entropy_Sources & | operator= (const Entropy_Sources &other)=delete |
size_t | poll (RandomNumberGenerator &rng, size_t bits, std::chrono::milliseconds timeout) |
size_t | poll_just (RandomNumberGenerator &rng, std::string_view src) |
Static Public Member Functions | |
static Entropy_Sources & | global_sources () |
Definition at line 55 of file entropy_src.h.
|
default |
|
explicit |
Definition at line 199 of file entropy_srcs.cpp.
References add_source(), and Botan::Entropy_Source::create().
|
delete |
|
delete |
void Botan::Entropy_Sources::add_source | ( | std::unique_ptr< Entropy_Source > | src | ) |
Definition at line 153 of file entropy_srcs.cpp.
Referenced by Entropy_Sources().
std::vector< std::string > Botan::Entropy_Sources::enabled_sources | ( | ) | const |
Definition at line 159 of file entropy_srcs.cpp.
|
static |
Definition at line 205 of file entropy_srcs.cpp.
References BOTAN_ENTROPY_DEFAULT_SOURCES.
Referenced by Botan::AutoSeeded_RNG::AutoSeeded_RNG().
|
delete |
size_t Botan::Entropy_Sources::poll | ( | RandomNumberGenerator & | rng, |
size_t | bits, | ||
std::chrono::milliseconds | timeout ) |
Poll all sources to collect bits
of entropy with a timeout
. Entropy collection is aborted as soon as either the requested number of bits are obtained or the timeout runs out. If the target system does not provide a clock, the timeout is ignored.
Note that the timeout is cooperative. If the poll() method of an entropy source blocks forever, this invocation will potentially also block.
Definition at line 168 of file entropy_srcs.cpp.
Referenced by Botan::RandomNumberGenerator::reseed().
size_t Botan::Entropy_Sources::poll_just | ( | RandomNumberGenerator & | rng, |
std::string_view | src ) |
Poll just a single named source. Ordinally only used for testing
Definition at line 189 of file entropy_srcs.cpp.