diff --git a/include/hash.h b/include/hash.h index 1a1b571a..5d56a108 100644 --- a/include/hash.h +++ b/include/hash.h @@ -33,8 +33,6 @@ u32 hash32(u8 *key, u32 len, u32 seed); u64 hash64(u8 *key, u32 len, u64 seed); -u32 hash32_xxh32(u8 *key, u32 len, u32 seed); - #if 0 The following code is disabled because xxh3 is 30% faster diff --git a/src/afl-fuzz-bitmap.c b/src/afl-fuzz-bitmap.c index d089b696..4ea14bd3 100644 --- a/src/afl-fuzz-bitmap.c +++ b/src/afl-fuzz-bitmap.c @@ -542,9 +542,8 @@ u8 __attribute__((hot)) save_if_interesting(afl_state_t *afl, void *mem, afl->fsrv.map_size); simplify_trace(afl, afl->san_fsrvs[0].trace_bits); - // cksum_simplified = hash64(afl->san_fsrvs[0].trace_bits, - // afl->fsrv.map_size, HASH_CONST); - cksum_simplified = hash32_xxh32(afl->san_fsrvs[0].trace_bits, + // Note: Original SAND implementation used XXHASH32 + cksum_simplified = hash32(afl->san_fsrvs[0].trace_bits, afl->fsrv.map_size, HASH_CONST); if (unlikely(!bitmap_read(afl->simplified_n_fuzz, cksum_simplified))) { @@ -570,7 +569,7 @@ u8 __attribute__((hot)) save_if_interesting(afl_state_t *afl, void *mem, likely(afl->san_abstraction == UNIQUE_TRACE)) { cksum_unique = - hash32_xxh32(afl->fsrv.trace_bits, afl->fsrv.map_size, HASH_CONST); + hash32(afl->fsrv.trace_bits, afl->fsrv.map_size, HASH_CONST); if (unlikely(!bitmap_read(afl->n_fuzz_dup, cksum) && fault == afl->crash_mode)) { diff --git a/src/afl-performance.c b/src/afl-performance.c index 3a2bc4b0..2bb787e4 100644 --- a/src/afl-performance.c +++ b/src/afl-performance.c @@ -423,17 +423,4 @@ char *sha1_hex_for_file(const char *fname, u32 len) { ck_free(tmp); return hex; -} - -#ifdef _DEBUG -u32 hash32_xxh32(u8 *key, u32 len, u32 seed) { - -#else -inline u32 hash32_xxh32(u8 *key, u32 len, u32 seed) { - -#endif - - (void)seed; - return (u32)XXH32(key, len, seed); - -} +} \ No newline at end of file