Since AES needs IV to be random (unless fed by a unit test), I was wondering how to properly handle it.
I know that Intel/AMD now supports the rdrand64
function but I don't fully want to rely on that.
Can I safely combine multiple sources of randomness and SHA256 them to produce a random 256-bit number?
My sources of randomness will be: time in ns, clock from rdtsc instruction, BCryptGenRandom (for windows, with /dev/random probably for linux) and a constantly increasing counter. I think this should make it pretty much uniformly random, or is there a drawback that I'm not seeing here?
Edit: and of course, the rdrand64 would also be included if available.