From ed8199402ff2a84e57f256818ebc2c505c2ac41d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 22 Feb 2016 18:44:43 +0100 Subject: util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG --- util/random.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util/random.lua') diff --git a/util/random.lua b/util/random.lua index e4b4a700..574e2e1c 100644 --- a/util/random.lua +++ b/util/random.lua @@ -6,6 +6,9 @@ -- COPYING file in the source package for more information. -- +local ok, crand = pcall(require, "util.crand"); +if ok then return crand; end + local urandom, urandom_err = io.open("/dev/urandom", "r"); local function seed() -- cgit v1.2.3