Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
427 B

  1. #include <strobe.h>
  2. #include <strobe_rng_init.h>
  3. extern uint8_t rng_save;
  4. extern int rng_save_len;
  5. void
  6. strobe_rng_init(void)
  7. {
  8. int r;
  9. /*
  10. * Seed RNG
  11. * On first boot, SRAM is uninitialized and randomness from
  12. * it is used. On reset, the previously saved state is used.
  13. */
  14. strobe_seed_prng(&rng_save, 2*1024);
  15. /*
  16. * Save entropy for next reset.
  17. */
  18. r = strobe_randomize(&rng_save, rng_save_len);
  19. (void)r;
  20. }