diff options
author | Ori Bernstein <ori@eigenstate.org> | 2018-10-07 11:37:10 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2018-10-07 11:37:44 -0700 |
commit | 954b2fd7a8a0a65a077b61a5932ed54d3e3ef6a5 (patch) | |
tree | a7b5c03808d36c6370543cf40bdb0a481e4abc71 /lib/crypto/entropy.myr | |
parent | f6eb57283f625cbd20d5bb423331e88ddc82c8f1 (diff) | |
download | mc-954b2fd7a8a0a65a077b61a5932ed54d3e3ef6a5.tar.gz |
Try /dev/urandom before /dev/random.
Speeds things up on Linux.
Diffstat (limited to 'lib/crypto/entropy.myr')
-rw-r--r-- | lib/crypto/entropy.myr | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/crypto/entropy.myr b/lib/crypto/entropy.myr index 8120791..b2e8ea9 100644 --- a/lib/crypto/entropy.myr +++ b/lib/crypto/entropy.myr @@ -7,7 +7,10 @@ pkg crypto = var randfd const __init__ = { - randfd = std.try(std.open("/dev/random", std.Oread)) + match std.open("/dev/urandom", std.Oread) + | `std.Ok fd: randfd = fd + | `std.Err e: randfd = std.try(std.open("/dev/random", std.Oread)) + ;; } const getentropy = {buf |