From ed59231db38dc793881f5183f3f81554e1691782 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 26 Mar 2015 16:56:01 +1000 Subject: [PATCH] More API cleanups to RNG --- libraries/Crypto/RNG.cpp | 20 +++----------------- libraries/Crypto/RNG.h | 1 - 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/libraries/Crypto/RNG.cpp b/libraries/Crypto/RNG.cpp index 02bc647f..b0268ad4 100644 --- a/libraries/Crypto/RNG.cpp +++ b/libraries/Crypto/RNG.cpp @@ -194,9 +194,8 @@ RNGClass::~RNGClass() * seed from and to save new seeds when save() is called. There must be * at least SEED_SIZE (49) bytes of EEPROM space available at the address. * - * This function should be followed by calls to stir() to mix in - * additional entropy data from noise sources to initialize the random - * number generator properly. + * This function should be followed by calls to addNoiseSource() to + * register the application's noise sources. * * \sa addNoiseSource(), stir(), save() */ @@ -447,18 +446,6 @@ void RNGClass::stir(const uint8_t *data, size_t len, unsigned int credit) } } -/** - * \brief Stirs in data from a noise source into the random pool. - * - * \param source The noise source to obtain entropy data from. - * - * \sa save(), NoiseSource::stir() - */ -void RNGClass::stir(NoiseSource &source) -{ - source.stir(); -} - /** * \brief Saves the random seed to EEPROM. * @@ -523,8 +510,7 @@ void RNGClass::loop() * if the device is captured, sold, or otherwise compromised. * * After this function is called, begin() must be called again to - * re-initialize the random number generator, followed by stir() to - * add in new entropy from system noise sources. + * re-initialize the random number generator. * * \note The rand() and save() functions take some care to manage the * random number pool in a way that makes prediction of past outputs from a diff --git a/libraries/Crypto/RNG.h b/libraries/Crypto/RNG.h index 2284d105..83740f10 100644 --- a/libraries/Crypto/RNG.h +++ b/libraries/Crypto/RNG.h @@ -43,7 +43,6 @@ public: bool available(size_t len) const; void stir(const uint8_t *data, size_t len, unsigned int credit = 0); - void stir(NoiseSource &source); void save();