From f6917780390db24af1af831d368039bfac8c6ded Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 17 Jul 2021 06:02:45 +0200 Subject: [PATCH] A slight tweak to the random generator to make sure the output is properly randomized from the start. --- src/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/random.c b/src/random.c index 4f7168c4b..fb1fead52 100644 --- a/src/random.c +++ b/src/random.c @@ -82,7 +82,7 @@ static void random_twist(uint32_t *val) uint8_t random_generate(void) { uint16_t r = 0; - r = (rand() ^ ROTATE_LEFT(preconst, rand() % 32)) % 256; + r = (RDTSC() ^ ROTATE_LEFT(preconst, rand() % 32)) % 256; random_twist(&preconst); return (r & 0xff); }