|
|
@@ -33,18 +33,14 @@ |
|
|
|
|
|
|
|
#include <utilities.h> |
|
|
|
|
|
|
|
#include <unistd.h> |
|
|
|
|
|
|
|
#define nitems(x) (sizeof(x) / sizeof *(x)) |
|
|
|
#define DEFINE_RNG_SAVE 1 |
|
|
|
#if DEFINE_RNG_SAVE |
|
|
|
const rng_word_t rng_save[roundup(32, sizeof(rng_word_t)) / sizeof(rng_word_t)] __attribute__ ((section (".eeprom"))); |
|
|
|
#endif |
|
|
|
|
|
|
|
/* |
|
|
|
* Note: This is the end of allocated SRAM, aka, the begining of |
|
|
|
* uninitalized SRAM. |
|
|
|
*/ |
|
|
|
extern uint8_t end; |
|
|
|
|
|
|
|
void |
|
|
|
strobe_rng_init(void) |
|
|
|
{ |
|
|
@@ -58,8 +54,10 @@ strobe_rng_init(void) |
|
|
|
/* |
|
|
|
* On first boot, SRAM is uninitialized and randomness from |
|
|
|
* it is used. |
|
|
|
* |
|
|
|
* Note: This depends upon sbrk pointing to uinitalized SRAM. |
|
|
|
*/ |
|
|
|
strobe_seed_prng(&end, 2*1024); |
|
|
|
strobe_seed_prng(sbrk(0), 2*1024); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|