mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
Update docs
This commit is contained in:
@@ -190,6 +190,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
</div><!-- fragment --><p>The <a class="el" href="classRNGClass.html#a8cb91e39f0c4591de5bf98b1e2880b13" title="Run periodic housekeeping tasks on the random number generator. ">loop()</a> function will automatically save the random number seed on a regular basis. By default the seed is saved every hour but this can be changed using <a class="el" href="classRNGClass.html#a5848e87a5f2f0302c88b0377f0e3366d" title="Sets the amount of time between automatic seed saves. ">setAutoSaveTime()</a>.</p>
|
||||
<p>Keep in mind that saving too often may cause the EEPROM to wear out quicker. It is wise to limit saving to once an hour or once a day depending upon how long you intend to field the device before replacing it. For example, an EEPROM rated for 100k erase/write cycles will last about 69 days saving once a minute or 11 years saving once an hour.</p>
|
||||
<p>The application can still elect to call <a class="el" href="classRNGClass.html#a139584fb249148e2058d1d645d090db7" title="Saves the random seed to EEPROM. ">save()</a> at any time if wants. For example, if the application can detect power loss or shutdown conditions programmatically, then it may make sense to force a <a class="el" href="classRNGClass.html#a139584fb249148e2058d1d645d090db7" title="Saves the random seed to EEPROM. ">save()</a> of the seed upon shutdown.</p>
|
||||
<p>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.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classNoiseSource.html" title="Abstract base class for random noise sources. ">NoiseSource</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8h_source.html#l00031">31</a> of file <a class="el" href="RNG_8h_source.html">RNG.h</a>.</p>
|
||||
@@ -211,7 +212,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
<p>This constructor must be followed by a call to <a class="el" href="classRNGClass.html#a7f1aab3c324f8e8a424d683425e0fcf8" title="Initializes the random number generator. ">begin()</a> to properly initialize the random number generator.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRNGClass.html#a7f1aab3c324f8e8a424d683425e0fcf8" title="Initializes the random number generator. ">begin()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00167">167</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00182">182</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,7 +241,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
<p>RNG supports a maximum of four noise sources. If the application needs more than that then the application must poll the noise sources itself by calling <a class="el" href="classNoiseSource.html#a7ce647815524fe84f562aca5256e12f3" title="Stirs entropy from this noise source into the global random number pool. ">NoiseSource::stir()</a> directly.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRNGClass.html#a8cb91e39f0c4591de5bf98b1e2880b13" title="Run periodic housekeeping tasks on the random number generator. ">loop()</a>, <a class="el" href="classRNGClass.html#a7f1aab3c324f8e8a424d683425e0fcf8" title="Initializes the random number generator. ">begin()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00249">249</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00379">379</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -283,7 +284,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
</div><!-- fragment --><p>If <em>len</em> is larger than the maximum number of entropy credits supported by the random number pool (384 bits, 48 bytes), then the maximum will be used instead. For example, asking if 512 bits (64 bytes) are available will return true if in reality only 384 bits are available. If this is a problem for the application's security requirements, then large requests for random data should be broken up into smaller chunks with the application waiting for the entropy pool to refill between chunks.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRNGClass.html#a418a833cf18198fd7e5d6dbd78c99c29" title="Generates random bytes into a caller-supplied buffer. ">rand()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00375">375</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00505">505</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -320,9 +321,10 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
</dd>
|
||||
</dl>
|
||||
<p>This function should be followed by calls to <a class="el" href="classRNGClass.html#aacf23b192b0e4cc8726d9abe05f5a9db" title="Adds a noise source to the random number generator. ">addNoiseSource()</a> to register the application's noise sources.</p>
|
||||
<p>The <em>eepromAddress</em> is ignored on the Arduino Due. The seed is instead stored in the last page of system flash memory.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRNGClass.html#aacf23b192b0e4cc8726d9abe05f5a9db" title="Adds a noise source to the random number generator. ">addNoiseSource()</a>, <a class="el" href="classRNGClass.html#ad99535ea23ae2fec55bdebb8c24def02" title="Stirs additional entropy data into the random pool. ">stir()</a>, <a class="el" href="classRNGClass.html#a139584fb249148e2058d1d645d090db7" title="Saves the random seed to EEPROM. ">save()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00202">202</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00296">296</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -345,7 +347,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
<dl class="section note"><dt>Note</dt><dd>The <a class="el" href="classRNGClass.html#a418a833cf18198fd7e5d6dbd78c99c29" title="Generates random bytes into a caller-supplied buffer. ">rand()</a> and <a class="el" href="classRNGClass.html#a139584fb249148e2058d1d645d090db7" title="Saves the random seed to EEPROM. ">save()</a> functions take some care to manage the random number pool in a way that makes prediction of past outputs from a captured state very difficult. Future outputs may be predictable if noise or other high-entropy data is not mixed in with <a class="el" href="classRNGClass.html#ad99535ea23ae2fec55bdebb8c24def02" title="Stirs additional entropy data into the random pool. ">stir()</a> on a regular basis.</dd></dl>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRNGClass.html#a7f1aab3c324f8e8a424d683425e0fcf8" title="Initializes the random number generator. ">begin()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00525">525</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00698">698</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -365,7 +367,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
<p>Run periodic housekeeping tasks on the random number generator. </p>
|
||||
<p>This function must be called on a regular basis from the application's main "loop()" function. </p>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00495">495</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00635">635</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -405,7 +407,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
<p>If the application requires a specific amount of entropy before generating important values, the <a class="el" href="classRNGClass.html#a49e3231ba65a5e4b045bc90976e0a659" title="Determine if there is sufficient entropy available for a specific request size. ">available()</a> function can be polled to determine when sufficient entropy is available.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRNGClass.html#a49e3231ba65a5e4b045bc90976e0a659" title="Determine if there is sufficient entropy available for a specific request size. ">available()</a>, <a class="el" href="classRNGClass.html#ad99535ea23ae2fec55bdebb8c24def02" title="Stirs additional entropy data into the random pool. ">stir()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00298">298</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00428">428</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -429,7 +431,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
<p>The seed that is saved is generated in such a way that it cannot be used to predict random values that were generated previously or subsequently in the current session. So a compromise of the EEPROM contents of a captured device should not result in compromise of random values that have already been generated. However, if power is lost and the system restarted, then there will be a short period of time where the random state will be predictable from the seed. For this reason it is very important to <a class="el" href="classRNGClass.html#ad99535ea23ae2fec55bdebb8c24def02" title="Stirs additional entropy data into the random pool. ">stir()</a> in new noise data at startup.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRNGClass.html#a8cb91e39f0c4591de5bf98b1e2880b13" title="Run periodic housekeeping tasks on the random number generator. ">loop()</a>, <a class="el" href="classRNGClass.html#ad99535ea23ae2fec55bdebb8c24def02" title="Stirs additional entropy data into the random pool. ">stir()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00477">477</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00607">607</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -458,7 +460,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
<p>This function is intended to help with EEPROM wear by slowing down how often seed data is saved as noise is stirred into the random pool. The exact period to use depends upon how long you intend to field the device before replacing it. For example, an EEPROM rated for 100k erase/write cycles will last about 69 days saving once a minute or 11 years saving once an hour.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRNGClass.html#a139584fb249148e2058d1d645d090db7" title="Saves the random seed to EEPROM. ">save()</a>, <a class="el" href="classRNGClass.html#ad99535ea23ae2fec55bdebb8c24def02" title="Stirs additional entropy data into the random pool. ">stir()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00274">274</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00404">404</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -506,7 +508,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
</div><!-- fragment --><p>If <em>credit</em> is zero, then the <em>data</em> will be stirred in but no entropy credit is given. This is useful for static values like serial numbers and MAC addresses that are different between devices but highly predictable.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRNGClass.html#a8cb91e39f0c4591de5bf98b1e2880b13" title="Run periodic housekeeping tasks on the random number generator. ">loop()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00408">408</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
<p>Definition at line <a class="el" href="RNG_8cpp_source.html#l00538">538</a> of file <a class="el" href="RNG_8cpp_source.html">RNG.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -517,7 +519,7 @@ static const int </td><td class="memItemRight" valign="bottom"><a class="el
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated on Sat Apr 18 2015 08:44:49 for ArduinoLibs by  <a href="http://www.doxygen.org/index.html">
|
||||
Generated on Sat May 2 2015 10:17:20 for ArduinoLibs by  <a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||
</a> 1.8.6
|
||||
</small></address>
|
||||
|
||||
Reference in New Issue
Block a user