mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-17 20:28:08 +00:00
fix for checksums
This commit is contained in:
@ -350,6 +350,7 @@
|
|||||||
(outHi) = vget_high_u32(vreinterpretq_u32_u64(in)); \
|
(outHi) = vget_high_u32(vreinterpretq_u32_u64(in)); \
|
||||||
\
|
\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define XXH_SPLIT_IN_PLACE(in, outLo, outHi) \
|
#define XXH_SPLIT_IN_PLACE(in, outLo, outHi) \
|
||||||
do { \
|
do { \
|
||||||
@ -358,6 +359,7 @@
|
|||||||
(outHi) = vshrn_n_u64((in), 32); \
|
(outHi) = vshrn_n_u64((in), 32); \
|
||||||
\
|
\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif /* XXH_VECTOR == XXH_NEON */
|
#endif /* XXH_VECTOR == XXH_NEON */
|
||||||
|
|
||||||
|
@ -1165,7 +1165,7 @@ static int XXH_isLittleEndian(void) {
|
|||||||
return one.c[0];
|
return one.c[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
\
|
|
||||||
#define XXH_CPU_LITTLE_ENDIAN XXH_isLittleEndian()
|
#define XXH_CPU_LITTLE_ENDIAN XXH_isLittleEndian()
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -1374,13 +1374,14 @@ static xxh_u32 XXH32_avalanche(xxh_u32 h32) {
|
|||||||
static xxh_u32 XXH32_finalize(xxh_u32 h32, const xxh_u8 *ptr, size_t len,
|
static xxh_u32 XXH32_finalize(xxh_u32 h32, const xxh_u8 *ptr, size_t len,
|
||||||
XXH_alignment align) {
|
XXH_alignment align) {
|
||||||
\
|
\
|
||||||
#define XXH_PROCESS1 \
|
#define XXH_PROCESS1 do {
|
||||||
do { \
|
|
||||||
\
|
h32 += (*ptr++) * XXH_PRIME32_5;
|
||||||
h32 += (*ptr++) * XXH_PRIME32_5; \
|
h32 = XXH_rotl32(h32, 11) * XXH_PRIME32_1;
|
||||||
h32 = XXH_rotl32(h32, 11) * XXH_PRIME32_1; \
|
|
||||||
\
|
}
|
||||||
} while (0)
|
|
||||||
|
while (0)
|
||||||
|
|
||||||
#define XXH_PROCESS4 \
|
#define XXH_PROCESS4 \
|
||||||
do { \
|
do { \
|
||||||
@ -1926,15 +1927,20 @@ XXH_FORCE_INLINE xxh_u64 XXH_readLE64_align(const void * ptr,
|
|||||||
|
|
||||||
/******* xxh64 *******/
|
/******* xxh64 *******/
|
||||||
|
|
||||||
static const xxh_u64 XXH_PRIME64_1 = 0x9E3779B185EBCA87ULL; /* 0b1001111000110111011110011011000110000101111010111100101010000111
|
static const xxh_u64 XXH_PRIME64_1 =
|
||||||
|
0x9E3779B185EBCA87ULL; /* 0b1001111000110111011110011011000110000101111010111100101010000111
|
||||||
*/
|
*/
|
||||||
static const xxh_u64 XXH_PRIME64_2 = 0xC2B2AE3D27D4EB4FULL; /* 0b1100001010110010101011100011110100100111110101001110101101001111
|
static const xxh_u64 XXH_PRIME64_2 =
|
||||||
|
0xC2B2AE3D27D4EB4FULL; /* 0b1100001010110010101011100011110100100111110101001110101101001111
|
||||||
*/
|
*/
|
||||||
static const xxh_u64 XXH_PRIME64_3 = 0x165667B19E3779F9ULL; /* 0b0001011001010110011001111011000110011110001101110111100111111001
|
static const xxh_u64 XXH_PRIME64_3 =
|
||||||
|
0x165667B19E3779F9ULL; /* 0b0001011001010110011001111011000110011110001101110111100111111001
|
||||||
*/
|
*/
|
||||||
static const xxh_u64 XXH_PRIME64_4 = 0x85EBCA77C2B2AE63ULL; /* 0b1000010111101011110010100111011111000010101100101010111001100011
|
static const xxh_u64 XXH_PRIME64_4 =
|
||||||
|
0x85EBCA77C2B2AE63ULL; /* 0b1000010111101011110010100111011111000010101100101010111001100011
|
||||||
*/
|
*/
|
||||||
static const xxh_u64 XXH_PRIME64_5 = 0x27D4EB2F165667C5ULL; /* 0b0010011111010100111010110010111100010110010101100110011111000101
|
static const xxh_u64 XXH_PRIME64_5 =
|
||||||
|
0x27D4EB2F165667C5ULL; /* 0b0010011111010100111010110010111100010110010101100110011111000101
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef XXH_OLD_NAMES
|
#ifdef XXH_OLD_NAMES
|
||||||
@ -1979,13 +1985,14 @@ static xxh_u64 XXH64_avalanche(xxh_u64 h64) {
|
|||||||
static xxh_u64 XXH64_finalize(xxh_u64 h64, const xxh_u8 *ptr, size_t len,
|
static xxh_u64 XXH64_finalize(xxh_u64 h64, const xxh_u8 *ptr, size_t len,
|
||||||
XXH_alignment align) {
|
XXH_alignment align) {
|
||||||
\
|
\
|
||||||
#define XXH_PROCESS1_64 \
|
#define XXH_PROCESS1_64 do {
|
||||||
do { \
|
|
||||||
\
|
h64 ^= (*ptr++) * XXH_PRIME64_5;
|
||||||
h64 ^= (*ptr++) * XXH_PRIME64_5; \
|
h64 = XXH_rotl64(h64, 11) * XXH_PRIME64_1;
|
||||||
h64 = XXH_rotl64(h64, 11) * XXH_PRIME64_1; \
|
|
||||||
\
|
}
|
||||||
} while (0)
|
|
||||||
|
while (0)
|
||||||
|
|
||||||
#define XXH_PROCESS4_64 \
|
#define XXH_PROCESS4_64 \
|
||||||
do { \
|
do { \
|
||||||
|
@ -66,11 +66,12 @@ static u8 *in_file, /* Analyzer input test case */
|
|||||||
static u8 *in_data; /* Input data for analysis */
|
static u8 *in_data; /* Input data for analysis */
|
||||||
|
|
||||||
static u32 in_len, /* Input data length */
|
static u32 in_len, /* Input data length */
|
||||||
orig_cksum, /* Original checksum */
|
|
||||||
total_execs, /* Total number of execs */
|
total_execs, /* Total number of execs */
|
||||||
exec_hangs, /* Total number of hangs */
|
exec_hangs, /* Total number of hangs */
|
||||||
exec_tmout = EXEC_TIMEOUT; /* Exec timeout (ms) */
|
exec_tmout = EXEC_TIMEOUT; /* Exec timeout (ms) */
|
||||||
|
|
||||||
|
static u64 orig_cksum; /* Original checksum */
|
||||||
|
|
||||||
static u64 mem_limit = MEM_LIMIT; /* Memory limit (MB) */
|
static u64 mem_limit = MEM_LIMIT; /* Memory limit (MB) */
|
||||||
|
|
||||||
static s32 dev_null_fd = -1; /* FD to /dev/null */
|
static s32 dev_null_fd = -1; /* FD to /dev/null */
|
||||||
|
@ -820,11 +820,14 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (afl->init_seed) {
|
if (afl->init_seed) {
|
||||||
|
|
||||||
afl->rand_seed[0] = afl->init_seed;
|
afl->rand_seed[0] = afl->init_seed;
|
||||||
afl->rand_seed[1] = afl->init_seed ^ 0x1234567890abcdef;
|
afl->rand_seed[1] = afl->init_seed ^ 0x1234567890abcdef;
|
||||||
afl->rand_seed[2] = afl->init_seed & 0x0123456789abcdef;
|
afl->rand_seed[2] = afl->init_seed & 0x0123456789abcdef;
|
||||||
afl->rand_seed[3] = afl->init_seed | 0x01abcde43f567908;
|
afl->rand_seed[3] = afl->init_seed | 0x01abcde43f567908;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// srandom((u32)afl->init_seed);
|
// srandom((u32)afl->init_seed);
|
||||||
// srand((u32)afl->init_seed); // in case it is a different implementation
|
// srand((u32)afl->init_seed); // in case it is a different implementation
|
||||||
|
|
||||||
|
@ -67,12 +67,13 @@ static u8 *in_file, /* Minimizer input test case */
|
|||||||
static u8 *in_data; /* Input data for trimming */
|
static u8 *in_data; /* Input data for trimming */
|
||||||
|
|
||||||
static u32 in_len, /* Input data length */
|
static u32 in_len, /* Input data length */
|
||||||
orig_cksum, /* Original checksum */
|
|
||||||
missed_hangs, /* Misses due to hangs */
|
missed_hangs, /* Misses due to hangs */
|
||||||
missed_crashes, /* Misses due to crashes */
|
missed_crashes, /* Misses due to crashes */
|
||||||
missed_paths, /* Misses due to exec path diffs */
|
missed_paths, /* Misses due to exec path diffs */
|
||||||
map_size = MAP_SIZE;
|
map_size = MAP_SIZE;
|
||||||
|
|
||||||
|
static u64 orig_cksum; /* Original checksum */
|
||||||
|
|
||||||
static u8 crash_mode, /* Crash-centric mode? */
|
static u8 crash_mode, /* Crash-centric mode? */
|
||||||
hang_mode, /* Minimize as long as it hangs */
|
hang_mode, /* Minimize as long as it hangs */
|
||||||
exit_crash, /* Treat non-zero exit as crash? */
|
exit_crash, /* Treat non-zero exit as crash? */
|
||||||
|
Reference in New Issue
Block a user