Randomness is compromised, but I was not able to find a random generator on Windows that is both fast and secure. I tried CryptGenRandom from wincrypt.h with multiple configurations and ways, but they all took longer than a minute to generate a single image using random dithering. This is why I chose to use just plain old rand().
I also choose to keep the contract of getrandom, so no changes had to be made to the functions already using getrandom.
Randomness is compromised, but I was not able to find a random generator on Windows that is both fast and secure. I tried
CryptGenRandom
fromwincrypt.h
with multiple configurations and ways, but they all took longer than a minute to generate a single image using random dithering. This is why I chose to use just plain oldrand()
.I also choose to keep the contract of
getrandom
, so no changes had to be made to the functions already usinggetrandom
.