about summary refs log tree commit diff
path: root/include/hash.h
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2020-06-23 15:08:49 +0200
committerDominik Maier <domenukk@gmail.com>2020-06-23 15:08:49 +0200
commitaad433e11efa4a8350a264313c66db8ef6d17088 (patch)
treea8249027f61f17e259e4a4ef6f2339e0394b1e35 /include/hash.h
parentc1eb2bccaae8f5b31546e6af3b00583e46bd842b (diff)
parent59e1a18197b08b08ad9e75b23fb6a5c740a0b9dd (diff)
downloadafl++-aad433e11efa4a8350a264313c66db8ef6d17088.tar.gz
Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev
Diffstat (limited to 'include/hash.h')
-rw-r--r--include/hash.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/hash.h b/include/hash.h
index cec51eac..6910e0e2 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -30,9 +30,16 @@
 
 #include "types.h"
 
-#ifdef __x86_64__
+u32 hash32(const void *key, u32 len, u32 seed);
+u64 hash64(const void *key, u32 len, u64 seed);
 
-  #define ROL64(_x, _r) ((((u64)(_x)) << (_r)) | (((u64)(_x)) >> (64 - (_r))))
+#if 0
+
+The following code is disabled because xxh3 is 30% faster
+
+  #ifdef __x86_64__
+
+    #define ROL64(_x, _r) ((((u64)(_x)) << (_r)) | (((u64)(_x)) >> (64 - (_r))))
 
 static inline u32 hash32(const void *key, u32 len, u32 seed) {
 
@@ -65,9 +72,9 @@ static inline u32 hash32(const void *key, u32 len, u32 seed) {
 
 }
 
-#else
+  #else
 
-  #define ROL32(_x, _r) ((((u32)(_x)) << (_r)) | (((u32)(_x)) >> (32 - (_r))))
+    #define ROL32(_x, _r) ((((u32)(_x)) << (_r)) | (((u32)(_x)) >> (32 - (_r))))
 
 static inline u32 hash32(const void *key, u32 len, u32 seed) {
 
@@ -100,7 +107,8 @@ static inline u32 hash32(const void *key, u32 len, u32 seed) {
 
 }
 
-#endif                                                       /* ^__x86_64__ */
+  #endif                                                     /* ^__x86_64__ */
+#endif
 
 #endif                                                     /* !_HAVE_HASH_H */