|
Botan 3.14.1
Crypto and TLS for C&
|
#include <entropy_src.h>
Public Types | |
| using | Sink = std::function<void(std::span<const uint8_t>)> |
Public Member Functions | |
| void | add (std::span< const uint8_t > data, size_t estimated_entropy_bits) |
| template<typename T> | |
| void | add_T (const T &t, size_t estimated_entropy_bits) |
| size_t | bits_collected () const |
| Entropy_Accumulator (const Entropy_Accumulator &other)=delete | |
| Entropy_Accumulator (Entropy_Accumulator &&other)=delete | |
| Entropy_Accumulator (size_t goal_bits, Sink sink) | |
| size_t | goal_bits () const |
| bool | goal_reached () const |
| Entropy_Accumulator & | operator= (const Entropy_Accumulator &other)=delete |
| Entropy_Accumulator & | operator= (Entropy_Accumulator &&other)=delete |
| ~Entropy_Accumulator ()=default | |
Friends | |
| class | Entropy_Source |
Collects entropy on behalf of an RNG which is being seeded
An Entropy_Source is handed an accumulator rather than the RNG itself. A source can only contribute data plus a conservative estimate of how much entropy that data contains. The RNG later decides, from the accumulated estimate, whether the seeding succeeded.
Definition at line 33 of file entropy_src.h.
| using Botan::Entropy_Accumulator::Sink = std::function<void(std::span<const uint8_t>)> |
Definition at line 35 of file entropy_src.h.
| Botan::Entropy_Accumulator::Entropy_Accumulator | ( | size_t | goal_bits, |
| Sink | sink ) |
| goal_bits | how many bits of entropy the caller hopes to collect |
| sink | receives all data contributed to the accumulator |
Definition at line 178 of file entropy_srcs.cpp.
References BOTAN_ARG_CHECK, and goal_bits().
Referenced by Entropy_Accumulator(), Entropy_Accumulator(), operator=(), and operator=().
|
delete |
References Entropy_Accumulator().
|
delete |
References Entropy_Accumulator().
|
default |
References add().
| void Botan::Entropy_Accumulator::add | ( | std::span< const uint8_t > | data, |
| size_t | estimated_entropy_bits ) |
Contribute data along with a conservative estimate of the entropy it contains. Data of unknown or untrusted quality should be contributed with an estimate of zero; it is still mixed into the RNG but not credited. The estimate is capped at the bit length of the data.
Definition at line 183 of file entropy_srcs.cpp.
Referenced by add_T(), Botan::Getentropy::gather(), Botan::Intel_Rdseed::gather(), and ~Entropy_Accumulator().
|
inline |
Contribute the representation of a trivial object, see add
Definition at line 62 of file entropy_src.h.
References add().
Referenced by Botan::Win32_EntropySource::gather().
|
inline |
Definition at line 69 of file entropy_src.h.
Referenced by Botan::Entropy_Sources::_gather(), Botan::Entropy_Sources::_gather_just(), Botan::Entropy_Source::poll(), and Botan::Entropy_Sources::poll().
|
inline |
Definition at line 74 of file entropy_src.h.
Referenced by Entropy_Accumulator().
|
inline |
Definition at line 79 of file entropy_src.h.
Referenced by Botan::Entropy_Sources::_gather(), and Botan::Entropy_Sources::poll().
|
delete |
References Entropy_Accumulator().
|
delete |
References Entropy_Accumulator().
|
friend |
Definition at line 82 of file entropy_src.h.
References Entropy_Source.
Referenced by Entropy_Source.