summaryrefslogtreecommitdiffstats
path: root/src/lib/randgen.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/randgen.h')
-rw-r--r--src/lib/randgen.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/randgen.h b/src/lib/randgen.h
new file mode 100644
index 0000000..d532880
--- /dev/null
+++ b/src/lib/randgen.h
@@ -0,0 +1,17 @@
+#ifndef RANDGEN_H
+#define RANDGEN_H
+
+/* Fill given buffer with semi-strong randomness */
+void random_fill(void *buf, size_t size);
+
+/* may be called multiple times,
+ and are called by default in lib_init */
+void random_init(void);
+void random_deinit(void);
+
+#ifdef DEBUG
+/* Debug helper to make random tests reproduceable. 0=got seed, -1=failure. */
+int rand_get_last_seed(unsigned int *seed_r);
+#endif
+
+#endif