diff --git a/Source/RNG/WELL.cpp b/Source/RNG/WELL.cpp index 4c970c76..9fa492bf 100644 --- a/Source/RNG/WELL.cpp +++ b/Source/RNG/WELL.cpp @@ -28,22 +28,9 @@ static auline void WELL_SeedRand64(WELLRand *rand, AuUInt64 seed) AuMemset(rand->state, 0, sizeof(rand->state)); - // Let's mess with the entropy in case there is an attempt to reverse the base seed from - // iterations of the WELL_NextLong_Unlocked function. Variance between mtrand and mtrand2 - // increases with each iteration up to a hopefully unknown value - AuUInt8 confuser = (MT_NextLong(&mtrand2) & 0xFF) / 5 + 5; - - for (int z = 0; z < confuser; z++) + for (unsigned int i = 0; i < AuArraySize(rand->state); i++) { - for (int i = 0; i < z; i++) - { - MT_NextLong(&mtrand); - } - - for (unsigned int i = 0; i < AuArraySize(rand->state); i++) - { - rand->state[i] = MT_NextLong(&mtrand) ^ MT_NextLong(&mtrand2); - } + rand->state[i] = MT_NextLong(&mtrand) ^ MT_NextLong(&mtrand2); } } @@ -53,19 +40,9 @@ static auline void WELL_SeedRand(WELLRand *rand, AuUInt32 seed) AuMemset(rand->state, 0, sizeof(rand->state)); - AuUInt8 confuser = (MT_NextLong(&mtrand) & 0xFF) / 5 + 5; - - for (int z = 0; z < confuser; z++) + for (unsigned int i = 0; i < AuArraySize(rand->state); i++) { - for (int i = 0; i < z; i++) - { - MT_NextLong(&mtrand); - } - - for (unsigned int i = 0; i < AuArraySize(rand->state); i++) - { - rand->state[i] = MT_NextLong(&mtrand); - } + rand->state[i] = MT_NextLong(&mtrand); } }