A slight tweak to the random generator to make sure the output is properly randomized from the start.

This commit is contained in:
OBattler
2021-07-17 06:02:45 +02:00
parent 5fc73eee7b
commit f691778039

View File

@@ -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);
}