about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2020-06-22 21:58:16 +0200
committerDominik Maier <domenukk@gmail.com>2020-06-22 21:58:23 +0200
commit7119bf5d860657dab7afb60fab8b7ad5dc0ef222 (patch)
tree8146668f22141e8f86627e451ad9d65cf99314d1 /include
parentea1222b33fb5e97165f649168b812d83ed1ed8c4 (diff)
downloadafl++-7119bf5d860657dab7afb60fab8b7ad5dc0ef222.tar.gz
Added rand, hash unittests
Diffstat (limited to 'include')
-rw-r--r--include/afl-fuzz.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index e7b52d56..16f7d717 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -49,6 +49,7 @@
 #include "sharedmem.h"
 #include "forkserver.h"
 #include "common.h"
+#include "hash.h"
 
 #include <stdio.h>
 #include <unistd.h>
@@ -971,13 +972,16 @@ static inline u32 rand_below(afl_state_t *afl, u32 limit) {
 
 }
 
-static inline u32 get_rand_seed(afl_state_t *afl) {
+static inline s64 rand_get_seed(afl_state_t *afl) {
 
-  if (unlikely(afl->fixed_seed)) { return (u32)afl->init_seed; }
+  if (unlikely(afl->fixed_seed)) { return afl->init_seed; }
   return afl->rand_seed[0];
 
 }
 
+/* initialize randomness with a given seed. Can be called again at any time. */
+void rand_set_seed(afl_state_t *afl, s64 init_seed);
+
 /* Find first power of two greater or equal to val (assuming val under
    2^63). */