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

Remove EEPROM address argument from RNG.begin()

Always store the seed at the very end of EEPROM memory.
This commit is contained in:
Rhys Weatherley
2017-11-04 10:18:05 +10:00
parent 506af269b7
commit d452bea037
9 changed files with 32 additions and 39 deletions

View File

@@ -207,7 +207,7 @@ void setup()
// Start the random number generator. We don't initialise a noise
// source here because we don't need one for testing purposes.
// Real DH applications should of course use a proper noise source.
RNG.begin("TestCurve25519 1.0", 950);
RNG.begin("TestCurve25519 1.0");
// Perform the tests.
testEval();

View File

@@ -173,7 +173,7 @@ void setup()
// Start the random number generator. We don't initialise a noise
// source here because we don't need one for testing purposes.
// Real applications should of course use a proper noise source.
RNG.begin("TestEd25519 1.0", 950);
RNG.begin("TestEd25519 1.0");
// Perform the tests.
testFixedVectors();

View File

@@ -503,7 +503,7 @@ void setup()
// Start the random number generator. We don't initialise a noise
// source here because we don't need one for testing purposes.
// Real DH applications should of course use a proper noise source.
RNG.begin("TestP521 1.0", 950);
RNG.begin("TestP521 1.0");
// Perform the tests.
testEval();

View File

@@ -11,9 +11,6 @@
// even if the input noise or seed data is otherwise identical.
#define RNG_APP_TAG "MyApp 1.0"
// EEPROM address to save the random number seed at.
#define RNG_EEPROM_ADDRESS 950
// Noise source to seed the random number generator.
TransistorNoiseSource noise(A1);
//RingOscillatorNoiseSource noise;
@@ -28,7 +25,7 @@ void setup() {
Serial.println("start");
// Initialize the random number generator.
RNG.begin(RNG_APP_TAG, RNG_EEPROM_ADDRESS);
RNG.begin(RNG_APP_TAG);
// Add the noise source to the list of sources known to RNG.
RNG.addNoiseSource(noise);