Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Ideally, you'd want a device which blocks if and only if the entropy pool hasn't been properly seeded yet, but which never blocks again after that point. Apparently this is what the BSDs do, but Linux doesn't have one.

The getrandom() call added in Linux 3.17 does this. By default it reads from urandom, but it blocks until it estimates that urandom has been seeded with "a sufficient number of bits", which seems to be around 128 bits of randomness.

http://man7.org/linux/man-pages/man2/getrandom.2.html

When available getrandom() should probably be preferred over both /dev/random and /dev/urandom.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: