4 ms·
Your random number generator shouldn't block.
by sitkack 13y ago
Your random number generator shouldn't block.
- pixl97 13y agoYour random number generator should give random numbers.
- mey 13y agoIt depends what type of random number you need. Having one interface isn't sufficient to describe the types of random applications need. A load balancing system probably doesn't have the same requirements as the RSA private key generation algorithm.
- derefr 13y agoWould it help to think of it as a (kernel) RNG daemon that you're trying to connect to, that doesn't finish starting up until it's seeded? That's basically what the blocking means, in the OpenBSD case.
- sitkack 13y agoWhich is the correct behavior. `/dev/urandom` should really be the only source of randomness on Linux. Mac [0] got this right, FreeBSD [1] gets this right. I totally agree with sockpuppet. Solving the tabula rasa system boot is a separate issue. Temporarily blocking for seeding is fine, my shouldn't was an RFC shouldn't. [0] https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man4/random.4.html https://developer.apple.com/library/mac/documentation/Darwin... [1] https://www.freebsd.org/cgi/man.cgi?query=random&sektion=4 https://www.freebsd.org/cgi/man.cgi?query=random&sektion=4
- Sanddancer 13y agoShould your filesystem just start returning a stream of nulls or other deterministic data if the device isn't ready yet? If there's no entropy to pull from, then the kernel shouldn't try to pretend that there is.