commit fa37ebd2f31b1bdf74bb186414890b4e043b5204
parent a71f9dbb60b135bfb3d4950681b89b78e1b8f0db
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Sat, 14 Jun 2025 10:49:33 +0200
perf_replies: fixed pseudo-random sequence generation
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/tools/perf_replies.c b/src/tools/perf_replies.c
@@ -1438,8 +1438,8 @@ mini_rnd (void)
{
/* Simple xoshiro256+ implementation */
static uint_fast64_t s[4] = {
- 0x76e15d3efefdcbbfuLL, 0xc5004e441c522fb3uLL,
- 0x77710069854ee241uLL, 0x39109bb02acbe635uLL
+ 0xE220A8397B1DCDAFuLL, 0x6E789E6AA1B965F4uLL,
+ 0x06C45D188009454FuLL, 0xF88BB8A8724C81ECuLL
}; /* Good enough for static initialisation */
const uint_fast64_t ret = (s[0] + s[3]) & 0xFFFFFFFFFFFFFFFFuLL;
@@ -1450,7 +1450,7 @@ mini_rnd (void)
s[1] ^= s[2];
s[0] ^= s[3];
s[2] ^= t;
- s[3] = ((s[3] << 45u) | (s[3] << (64u - 45u))) & 0xFFFFFFFFFFFFFFFFuLL;
+ s[3] = ((s[3] << 45u) | (s[3] >> (64u - 45u))) & 0xFFFFFFFFFFFFFFFFuLL;
return ret;
}
@@ -1531,7 +1531,7 @@ init_response_body_data (void)
body_dyn[pos + 4] = (char) (unsigned char) (rnd_data >> 32);
body_dyn[pos + 5] = (char) (unsigned char) (rnd_data >> 40);
body_dyn[pos + 6] = (char) (unsigned char) (rnd_data >> 48);
- body_dyn[pos + 7] = (char) (unsigned char) (rnd_data >> 54);
+ body_dyn[pos + 7] = (char) (unsigned char) (rnd_data >> 56);
}
rnd_data = mini_rnd ();
for ((void) pos; pos < body_dyn_size; ++pos)