Skip to content
Snippets Groups Projects
Unverified Commit 3a66df0c authored by Joakim Nohlgård's avatar Joakim Nohlgård Committed by GitHub
Browse files

Merge pull request #8225 from gebart/pr/hwrng-init

periph_common: Call hwrng_init when enabled
parents cdf4b7a5 c0fd1727
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
#ifdef MODULE_PERIPH_RTC #ifdef MODULE_PERIPH_RTC
#include "periph/rtc.h" #include "periph/rtc.h"
#endif #endif
#ifdef MODULE_PERIPH_HWRNG
#include "periph/hwrng.h"
#endif
void periph_init(void) void periph_init(void)
{ {
...@@ -40,4 +43,8 @@ void periph_init(void) ...@@ -40,4 +43,8 @@ void periph_init(void)
#ifdef MODULE_PERIPH_RTC #ifdef MODULE_PERIPH_RTC
rtc_init(); rtc_init();
#endif #endif
#ifdef MODULE_PERIPH_HWRNG
hwrng_init();
#endif
} }
...@@ -34,9 +34,6 @@ int main(void) ...@@ -34,9 +34,6 @@ int main(void)
printf("This test will print from 1 to %u random bytes about every " printf("This test will print from 1 to %u random bytes about every "
"second\n\n", LIMIT); "second\n\n", LIMIT);
puts("Initializing the HWRNG driver.\n");
hwrng_init();
while (1) { while (1) {
/* zero out buffer */ /* zero out buffer */
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
......
...@@ -61,9 +61,6 @@ int main(void) ...@@ -61,9 +61,6 @@ int main(void)
printf("Testing %d random private key pairs and signature using HWRNG\n", TESTROUNDS); printf("Testing %d random private key pairs and signature using HWRNG\n", TESTROUNDS);
/* initialize hardware random number generator */
hwrng_init();
uint8_t l_private1[curve_size]; uint8_t l_private1[curve_size];
uint8_t l_private2[curve_size]; uint8_t l_private2[curve_size];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment