#include <entropy_src.h>
Definition at line 55 of file entropy_src.h.
◆ Entropy_Sources() [1/4]
Botan::Entropy_Sources::Entropy_Sources |
( |
| ) |
|
|
default |
◆ Entropy_Sources() [2/4]
Botan::Entropy_Sources::Entropy_Sources |
( |
const std::vector< std::string > & | sources | ) |
|
|
explicit |
◆ Entropy_Sources() [3/4]
◆ Entropy_Sources() [4/4]
◆ add_source()
void Botan::Entropy_Sources::add_source |
( |
std::unique_ptr< Entropy_Source > | src | ) |
|
◆ enabled_sources()
std::vector< std::string > Botan::Entropy_Sources::enabled_sources |
( |
| ) |
const |
Definition at line 131 of file entropy_srcs.cpp.
131 {
132 std::vector<std::string> sources;
133 sources.reserve(m_srcs.size());
134 for(const auto& src : m_srcs) {
135 sources.push_back(src->name());
136 }
137 return sources;
138}
◆ global_sources()
◆ operator=()
◆ poll()
size_t Botan::Entropy_Sources::poll |
( |
RandomNumberGenerator & | rng, |
|
|
size_t | bits, |
|
|
std::chrono::milliseconds | timeout ) |
Definition at line 140 of file entropy_srcs.cpp.
140 {
141 typedef std::chrono::system_clock clock;
142
143 auto deadline = clock::now() + timeout;
144
145 size_t bits_collected = 0;
146
147 for(auto& src : m_srcs) {
148 bits_collected += src->poll(rng);
149
150 if(bits_collected >= poll_bits || clock::now() > deadline) {
151 break;
152 }
153 }
154
155 return bits_collected;
156}
Referenced by Botan::RandomNumberGenerator::reseed().
◆ poll_just()
Poll just a single named source. Ordinally only used for testing
Definition at line 158 of file entropy_srcs.cpp.
158 {
159 for(auto& src : m_srcs) {
160 if(src->name() == the_src) {
161 return src->poll(rng);
162 }
163 }
164
165 return 0;
166}
The documentation for this class was generated from the following files: