|
Botan 3.14.1
Crypto and TLS for C&
|
#include <rdseed.h>
Public Member Functions | |
| void | gather (Entropy_Accumulator &acc) override |
| std::string | name () const override |
| virtual size_t | poll (RandomNumberGenerator &rng) |
Static Public Member Functions | |
| static std::unique_ptr< Entropy_Source > | create (std::string_view type) |
Entropy source using the rdseed instruction first introduced on Intel's Broadwell architecture.
|
staticinherited |
Return a new entropy source of a particular type, or null Each entropy source may require substantial resources (eg, a file handle or socket instance), so try to share them among multiple RNGs, or just use the preconfigured global list accessed by Entropy_Sources::global_sources()
Definition at line 217 of file entropy_srcs.cpp.
References Botan::Processor_RNG::available(), BOTAN_UNUSED, Botan::Jitter_RNG::Default, Botan::Jitter_RNG::FIPS, name(), and Botan::Jitter_RNG::NTG1.
Referenced by Botan::Entropy_Sources::Entropy_Sources().
|
overridevirtual |
Perform an entropy gathering poll
Contribute data to acc, each contribution along with a conservative estimate of the entropy it contains. Data which should be mixed in but not trusted is contributed with an estimate of zero. A source may stop early once acc.goal_reached() returns true.
Any implementation of this function should be thread safe; it may be called concurrently in multiple threads if multiple stateful RNGs reseed across different threads.
The default implementation exists only to support subclasses which implement the legacy poll interface, and forwards to poll.
Note that applications should not directly invoke this function to perform reseeding; use RandomNumberGenerator::reseed_from with an instance of Entropy_Sources which contains this source.
TODO(Botan4) make this a pure virtual
Reimplemented from Botan::Entropy_Source.
Definition at line 67 of file rdseed.cpp.
References Botan::Entropy_Accumulator::add(), Botan::CPUID::has(), and Botan::CPUFeature::RDSEED.
|
inlineoverridevirtual |
Return a free-form string identifying this entropy source
Implements Botan::Entropy_Source.
Definition at line 21 of file rdseed.h.
|
virtualinherited |
Perform an entropy gathering poll (legacy interface)
| Random Number Generators | will be provided with entropy via calls to add_entropy |
New sources should implement gather instead. The default implementation of this function forwards to gather.
TODO(Botan4) remove this function
Definition at line 206 of file entropy_srcs.cpp.
References Botan::Entropy_Accumulator::bits_collected(), Botan::RandomNumberGenerator::DefaultPollBits, Botan::fmt(), gather(), and name().