#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 159 of file entropy_srcs.cpp.
159 {
160 std::vector<std::string> sources;
161 sources.reserve(m_srcs.size());
162 for(const auto& src : m_srcs) {
163 sources.push_back(src->name());
164 }
165 return sources;
166}
◆ global_sources()
◆ operator=()
◆ poll()
size_t Botan::Entropy_Sources::poll |
( |
RandomNumberGenerator & | rng, |
|
|
size_t | bits, |
|
|
std::chrono::milliseconds | timeout ) |
Definition at line 168 of file entropy_srcs.cpp.
168 {
169 typedef std::chrono::system_clock clock;
170
171 auto deadline = clock::now() + timeout;
172
173 size_t bits_collected = 0;
174
175 for(auto& src : m_srcs) {
176 bits_collected += src->poll(rng);
177
178 if(bits_collected >= poll_bits || clock::now() > deadline) {
179 break;
180 }
181 }
182
183 return bits_collected;
184}
Referenced by Botan::RandomNumberGenerator::reseed().
◆ poll_just()
Poll just a single named source. Ordinally only used for testing
Definition at line 186 of file entropy_srcs.cpp.
186 {
187 for(auto& src : m_srcs) {
188 if(src->name() == the_src) {
189 return src->poll(rng);
190 }
191 }
192
193 return 0;
194}
The documentation for this class was generated from the following files: