mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-17 04:18:06 +00:00
cleanup of hot fix for -s on 32-bit
This commit is contained in:
@ -590,7 +590,8 @@ typedef struct afl_state {
|
|||||||
|
|
||||||
u32 rand_cnt; /* Random number counter */
|
u32 rand_cnt; /* Random number counter */
|
||||||
|
|
||||||
u64 rand_seed[3];
|
/* unsigned long rand_seed[3]; would also work */
|
||||||
|
AFL_RAND_RETURN rand_seed[3];
|
||||||
s64 init_seed;
|
s64 init_seed;
|
||||||
|
|
||||||
u64 total_cal_us, /* Total calibration time (us) */
|
u64 total_cal_us, /* Total calibration time (us) */
|
||||||
|
@ -56,13 +56,13 @@ inline AFL_RAND_RETURN rand_next(afl_state_t *afl) {
|
|||||||
// RomuTrio32
|
// RomuTrio32
|
||||||
inline AFL_RAND_RETURN rand_next(afl_state_t *afl) {
|
inline AFL_RAND_RETURN rand_next(afl_state_t *afl) {
|
||||||
|
|
||||||
AFL_RAND_RETURN xp = (u32)afl->rand_seed[0], yp = (u32)afl->rand_seed[1],
|
AFL_RAND_RETURN xp = afl->rand_seed[0], yp = afl->rand_seed[1],
|
||||||
zp = (u32)afl->rand_seed[2];
|
zp = afl->rand_seed[2];
|
||||||
afl->rand_seed[0] = 3323815723u * zp;
|
afl->rand_seed[0] = 3323815723u * zp;
|
||||||
afl->rand_seed[1] = yp - xp;
|
afl->rand_seed[1] = yp - xp;
|
||||||
afl->rand_seed[1] = ROTL((u32)afl->rand_seed[1], 6);
|
afl->rand_seed[1] = ROTL(afl->rand_seed[1], 6);
|
||||||
afl->rand_seed[2] = zp - yp;
|
afl->rand_seed[2] = zp - yp;
|
||||||
afl->rand_seed[2] = ROTL((u32)afl->rand_seed[2], 22);
|
afl->rand_seed[2] = ROTL(afl->rand_seed[2], 22);
|
||||||
return xp;
|
return xp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user