37 void begin(
const char *tag);
42 void rand(uint8_t *data,
size_t len);
45 void stir(
const uint8_t *data,
size_t len,
unsigned int credit = 0);
58 uint16_t credits : 13;
59 uint16_t firstSave : 1;
60 uint16_t initialized : 1;
61 uint16_t trngPending : 1;
63 unsigned long timeout;
Abstract base class for random noise sources.
Pseudo random number generator suitable for cryptography.
void save()
Saves the random seed to EEPROM.
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
void setAutoSaveTime(uint16_t minutes)
Sets the amount of time between automatic seed saves.
void begin(const char *tag)
Initializes the random number generator.
void loop()
Run periodic housekeeping tasks on the random number generator.
void destroy()
Destroys the data in the random number pool and the saved seed in EEPROM.
void addNoiseSource(NoiseSource &source)
Adds a noise source to the random number generator.
bool available(size_t len) const
Determine if there is sufficient entropy available for a specific request size.
RNGClass()
Constructs a new random number generator instance.
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
static const int SEED_SIZE
Size of a saved random number seed in EEPROM space.
~RNGClass()
Destroys this random number generator instance.