1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Save the RNG seed to flash memory on the Due

This commit is contained in:
Rhys Weatherley
2015-05-02 09:40:13 +10:00
parent c0470980de
commit 2e64f4bec9
2 changed files with 87 additions and 26 deletions

View File

@@ -153,13 +153,13 @@ Because the device may be restarted before the first hour expires, there
is a special case in the code: the first time that the entropy pool
fills up, a save will be automatically forced.
\note The Arduino Due does not have EEPROM so it cannot save the random
number seed across system restarts. Instead the \link RNGClass RNG\endlink
class will mix in data from the CPU's built-in True Random Number
Generator (TRNG). Assuming that the CPU's TRNG is trustworthy,
this should be sufficient to properly seed the random number generator.
It is recommended to also mix in data from other noise sources just in
case the CPU's TRNG is not trustworthy.
The Arduino Due does not have EEPROM so RNG saves the seed into
the last page of system flash memory instead. The RNG class will also
mix in data from the CPU's built-in True Random Number Generator (TRNG).
Assuming that the CPU's TRNG is trustworthy, this should be sufficient
to properly seed the random number generator. It is recommended to
also mix in data from other noise sources just in case the CPU's TRNG
is not trustworthy.
To use the random number generator properly, there are some regular tasks
that must be performed every time around the application's main loop().