From 4e75b40d8a96c5d51490ddea43566fe8e6d4168c Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 9 Apr 2022 02:28:05 +0000 Subject: Prepare for 2.12.0.0. librandom revamp. Signed-off-by: Laurent Bercot --- src/librandom/random_init.c | 72 --------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 src/librandom/random_init.c (limited to 'src/librandom/random_init.c') diff --git a/src/librandom/random_init.c b/src/librandom/random_init.c deleted file mode 100644 index cd880e8..0000000 --- a/src/librandom/random_init.c +++ /dev/null @@ -1,72 +0,0 @@ -/* ISC license. */ - -#include - -#ifdef SKALIBS_HASARC4RANDOM - -#include -#include - -#include - -int random_init () -{ -#ifdef SKALIBS_HASARC4RANDOM_ADDRANDOM - char seed[160] ; - random_makeseed(seed) ; - arc4random_addrandom((unsigned char *)seed, 160) ; -#endif - return 1 ; -} - -#else -#ifdef SKALIBS_HASGETRANDOM - -#include - -int random_init () -{ - return 1 ; -} - -#else - -#include -#include -#include "random-internal.h" - -SURFSchedule surf_here = SURFSCHEDULE_ZERO ; - -#ifdef SKALIBS_HASDEVURANDOM - -#include - -#include - -int random_fd = -1 ; - -int random_init () -{ - if (random_fd >= 0) return 1 ; - random_fd = openc_readb("/dev/urandom") ; - return random_fd >= 0 ; -} - -#else /* default */ - -int random_init () -{ - static int initted = 0 ; - if (!initted) - { - char seed[160] ; - initted = 1 ; - random_makeseed(seed) ; - surf_init(&surf_here, seed) ; - } - return 1 ; -} - -#endif -#endif -#endif -- cgit v1.3.1