From 59ba85698386d2d55c86a00557169f3f5efad502 Mon Sep 17 00:00:00 2001 From: Silke Hofstra Date: Thu, 20 Sep 2018 16:32:40 +0200 Subject: [PATCH] Add support for RIOT OS --- impl/random.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/impl/random.h b/impl/random.h index f2ca1a4..2c09e02 100644 --- a/impl/random.h +++ b/impl/random.h @@ -99,6 +99,18 @@ hydro_random_init(void) return 0; } +#elif defined(RIOT_VERSION) && !defined(__unix__) + +#include + +static int +hydro_random_init(void) +{ + random_bytes(hydro_random_context.state, sizeof hydro_random_context.state); + hydro_random_context.counter = ~LOAD64_LE(hydro_random_context.state); + return 0; +} + #elif defined(_WIN32) #include -- 2.18.0