aboutsummaryrefslogtreecommitdiff
path: root/src/rnd.c
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2020-09-10 13:17:25 +0930
committerDavid Timber <mieabby@gmail.com>2020-09-10 13:17:25 +0930
commitc4160ed41717260b5941e2729c444b8ec051d5f0 (patch)
treeebff8d607109689adce32b25e02d294cd86c251d /src/rnd.c
parentbb797b9a405090d69cae75d2ef76cb797449886c (diff)
* Impl: rnd interface and WELL512
* cncp: query cnc txt rec after wait not before * In case the child keeps on dying
Diffstat (limited to 'src/rnd.c')
-rw-r--r--src/rnd.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/rnd.c b/src/rnd.c
new file mode 100644
index 0000000..1203e29
--- /dev/null
+++ b/src/rnd.c
@@ -0,0 +1,22 @@
+#include "rnd.h"
+#include "util_rt.h"
+
+
+void prne_init_rnd (prne_rnd_t *p) {
+ prne_memzero(p, sizeof(prne_rnd_t));
+}
+
+void prne_free_rnd (prne_rnd_t *p) {
+ if (p == NULL) {
+ return;
+ }
+
+ if (p->free_ctx_f != NULL) {
+ p->free_ctx_f(p->ctx);
+ }
+ prne_memzero(p, sizeof(prne_rnd_t));
+}
+
+bool prne_rnd (prne_rnd_t *p, uint8_t *buf, const size_t len) {
+ return p->random(p->ctx, buf, len);
+}