#include <entropy_src.h>
Definition at line 56 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 175 of file entropy_srcs.cpp.
176 {
177 std::vector<std::string> sources;
178 for(size_t i = 0; i != m_srcs.size(); ++i)
179 {
180 sources.push_back(m_srcs[i]->
name());
181 }
182 return sources;
183 }
References name.
◆ global_sources()
Definition at line 227 of file entropy_srcs.cpp.
228 {
229 static Entropy_Sources global_entropy_sources(BOTAN_ENTROPY_DEFAULT_SOURCES);
230
231 return global_entropy_sources;
232 }
Entropy_Sources()=default
◆ operator=()
◆ poll()
size_t Botan::Entropy_Sources::poll |
( |
RandomNumberGenerator & |
rng, |
|
|
size_t |
bits, |
|
|
std::chrono::milliseconds |
timeout |
|
) |
| |
Definition at line 185 of file entropy_srcs.cpp.
188 {
189 typedef std::chrono::system_clock clock;
190
191 auto deadline = clock::now() + timeout;
192
193 size_t bits_collected = 0;
194
195 for(size_t i = 0; i != m_srcs.size(); ++i)
196 {
197 bits_collected += m_srcs[i]->poll(rng);
198
199 if (bits_collected >= poll_bits || clock::now() > deadline)
200 break;
201 }
202
203 return bits_collected;
204 }
Referenced by Botan::RandomNumberGenerator::reseed().
◆ poll_just()
Poll just a single named source. Ordinally only used for testing
Definition at line 206 of file entropy_srcs.cpp.
207 {
208 for(size_t i = 0; i != m_srcs.size(); ++i)
209 {
210 if(m_srcs[i]->
name() == the_src)
211 {
212 return m_srcs[i]->poll(rng);
213 }
214 }
215
216 return 0;
217 }
References name.
The documentation for this class was generated from the following files: