random: add support for RIOT
@@ -21,6 +21,8 @@ static TLS struct {
# include "random/unix.h"
#elif defined(TARGET_LIKE_MBED)
# include "random/mbed.h"
+#elif defined(RIOT_VERSION)
+# include "random/riot.h"
#else
#error Unsupported platform
#endif
@@ -0,0 +1,10 @@
+#include <random.h>
+
+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;
+}