mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 11:58:08 +00:00
Use AFL hash32
This commit is contained in:
@ -33,8 +33,6 @@
|
|||||||
u32 hash32(u8 *key, u32 len, u32 seed);
|
u32 hash32(u8 *key, u32 len, u32 seed);
|
||||||
u64 hash64(u8 *key, u32 len, u64 seed);
|
u64 hash64(u8 *key, u32 len, u64 seed);
|
||||||
|
|
||||||
u32 hash32_xxh32(u8 *key, u32 len, u32 seed);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
The following code is disabled because xxh3 is 30% faster
|
The following code is disabled because xxh3 is 30% faster
|
||||||
|
@ -542,9 +542,8 @@ u8 __attribute__((hot)) save_if_interesting(afl_state_t *afl, void *mem,
|
|||||||
afl->fsrv.map_size);
|
afl->fsrv.map_size);
|
||||||
simplify_trace(afl, afl->san_fsrvs[0].trace_bits);
|
simplify_trace(afl, afl->san_fsrvs[0].trace_bits);
|
||||||
|
|
||||||
// cksum_simplified = hash64(afl->san_fsrvs[0].trace_bits,
|
// Note: Original SAND implementation used XXHASH32
|
||||||
// afl->fsrv.map_size, HASH_CONST);
|
cksum_simplified = hash32(afl->san_fsrvs[0].trace_bits,
|
||||||
cksum_simplified = hash32_xxh32(afl->san_fsrvs[0].trace_bits,
|
|
||||||
afl->fsrv.map_size, HASH_CONST);
|
afl->fsrv.map_size, HASH_CONST);
|
||||||
|
|
||||||
if (unlikely(!bitmap_read(afl->simplified_n_fuzz, cksum_simplified))) {
|
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)) {
|
likely(afl->san_abstraction == UNIQUE_TRACE)) {
|
||||||
|
|
||||||
cksum_unique =
|
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) &&
|
if (unlikely(!bitmap_read(afl->n_fuzz_dup, cksum) &&
|
||||||
fault == afl->crash_mode)) {
|
fault == afl->crash_mode)) {
|
||||||
|
|
||||||
|
@ -424,16 +424,3 @@ char *sha1_hex_for_file(const char *fname, u32 len) {
|
|||||||
return hex;
|
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);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user