evanpacini / netpbm-c

Some headers and experiments with netpbm and C.
Creative Commons Zero v1.0 Universal
2 stars 0 forks source link

Make the code run on Windows. #3

Closed KaspervanM closed 1 year ago

KaspervanM commented 1 year ago

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.