about summary refs log tree commit diff
path: root/src/afl-performance.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-06-19 18:05:04 +0200
committervan Hauser <vh@thc.org>2020-06-19 18:05:04 +0200
commitde2c565953228a52b2ac75b778b27aab983151c6 (patch)
tree39b0a476721ef6e18cec35376f7881c3098501da /src/afl-performance.c
parent758f136d3ec11ad9bff39643962a4f2320713a6a (diff)
downloadafl++-de2c565953228a52b2ac75b778b27aab983151c6.tar.gz
first commit, looks good
Diffstat (limited to 'src/afl-performance.c')
-rw-r--r--src/afl-performance.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/afl-performance.c b/src/afl-performance.c
index 8efefcd8..07069108 100644
--- a/src/afl-performance.c
+++ b/src/afl-performance.c
@@ -33,10 +33,12 @@ static inline uint64_t rotl(const uint64_t x, int k) {
 
 }
 
-uint64_t rand_next(afl_state_t *afl) {
+uint32_t rand_next(afl_state_t *afl) {
 
-  const uint64_t result =
-      rotl(afl->rand_seed[0] + afl->rand_seed[3], 23) + afl->rand_seed[0];
+  const uint32_t result =
+      (uint32_t)rotl(afl->rand_seed[0] + afl->rand_seed[3], 23) +
+      afl->rand_seed[0];
+  //  const uint32_t result = (uint32_t) rotl(afl->rand_seed[1] * 5, 7) * 9;
 
   const uint64_t t = afl->rand_seed[1] << 17;
 
@@ -49,7 +51,7 @@ uint64_t rand_next(afl_state_t *afl) {
 
   afl->rand_seed[3] = rotl(afl->rand_seed[3], 45);
 
-  return result;
+  return (uint32_t)result;
 
 }