|
Botan 3.13.0
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 |
| Entropy_Sources & | operator= (Entropy_Sources &&other)=delete |
| size_t | poll (RandomNumberGenerator &rng, size_t bits) |
| size_t | poll (RandomNumberGenerator &rng, size_t bits, std::chrono::milliseconds timeout) |
| size_t | poll_just (RandomNumberGenerator &rng, std::string_view src) |
| ~Entropy_Sources ()=default | |
Static Public Member Functions | |
| static Entropy_Sources & | global_sources () |
A collection of entropy sources which can be polled together
Definition at line 68 of file entropy_src.h.
|
default |
Create an empty collection of entropy sources
References Entropy_Sources().
Referenced by Entropy_Sources(), Entropy_Sources(), Entropy_Sources(), global_sources(), operator=(), and operator=().
|
explicit |
Create a collection containing the named entropy sources
| sources | the names of the sources to enable |
Definition at line 214 of file entropy_srcs.cpp.
References add_source(), and Botan::Entropy_Source::create().
|
delete |
References Entropy_Sources().
|
delete |
References Entropy_Sources().
|
default |
| void Botan::Entropy_Sources::add_source | ( | std::unique_ptr< Entropy_Source > | src | ) |
Add an entropy source to this collection
| src | the source to add |
Definition at line 154 of file entropy_srcs.cpp.
Referenced by Entropy_Sources().
| std::vector< std::string > Botan::Entropy_Sources::enabled_sources | ( | ) | const |
List the entropy sources in this collection
Definition at line 160 of file entropy_srcs.cpp.
|
static |
Access the process-wide set of entropy sources used by default
Definition at line 220 of file entropy_srcs.cpp.
References Entropy_Sources().
Referenced by Botan::AutoSeeded_RNG::AutoSeeded_RNG().
|
delete |
References Entropy_Sources().
|
delete |
References Entropy_Sources().
| size_t Botan::Entropy_Sources::poll | ( | RandomNumberGenerator & | rng, |
| size_t | bits ) |
Poll all sources to collect bits of entropy. Entropy collection is aborted as soon as the requested number of bits are obtained or the timeout runs out.
Definition at line 190 of file entropy_srcs.cpp.
| 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.
TODO(Botan4) remove this variant, and the <chrono> include above
Definition at line 169 of file entropy_srcs.cpp.
Referenced by Botan::RandomNumberGenerator::reseed_from_sources().
| 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 204 of file entropy_srcs.cpp.