aboutsummaryrefslogtreecommitdiffstats
path: root/fuzzer/mt19937.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fuzzer/mt19937.cpp')
-rw-r--r--fuzzer/mt19937.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/fuzzer/mt19937.cpp b/fuzzer/mt19937.cpp
new file mode 100644
index 0000000..984f1fb
--- /dev/null
+++ b/fuzzer/mt19937.cpp
@@ -0,0 +1,17 @@
+#include <random>
+#include <cstdint>
+
+std::mt19937* mt_rand = NULL;
+
+extern "C" void fuzz_mt19937_init(uint32_t seed) {
+ mt_rand = new std::mt19937(seed);
+}
+
+extern "C" uint32_t fuzz_mt19937_get(void) {
+ return (*mt_rand)();
+}
+
+extern "C" void fuzz_mt19937_destroy(void) {
+ delete mt_rand;
+ mt_rand = NULL;
+}