4 ms·
Excuse me for asking a stupid question, I am not too deep into linux kernel randomness generation: Why is /dev/urandom spitting out anything before it has acqu
by onnoonno 12y ago
Excuse me for asking a stupid question, I am not too deep into linux kernel randomness generation:
Why is /dev/urandom spitting out anything before it has acquired enough entropy for the initial seed? Wouldn't it be a good idea for it to initially block?
- taejo 12y agoYes. But it would break userspace to change it now (because some init script might block trying to read /dev/urandom)
- bradleyjg 12y agoThe contract when /dev/random and /dev/urandom came out was that urandom would never, ever block. On a system with a recent Intel processor, there's a instruction (RDSEED) that uses on on-die hardware RNG. I'm not familiar with the standard linux boot-up process, but it could in principle seed urandom using RDSEED arbitrarily early in the process. That should work on VMs too unless the hypervisor is blocking access (can't imagine a good reason for that). Via has on-die RNG considerably longer, though it's accessed slightly differently. I don't believe AMD or ARM has anything similar.