55#include <openssl/rand.h>
77#define NUM_RAND_POLL_RETRIES 8
79 for (
i = 0;
i < NUM_RAND_POLL_RETRIES;
i++)
81 if (RAND_status() == 1)
90 if (RAND_bytes(
buf,
len) == 1)
102static HCRYPTPROV hProvider = 0;
115 if (!CryptAcquireContext(&hProvider,
119 CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
131 if (CryptGenRandom(hProvider,
len,
buf))
156 f = open(
"/dev/urandom", O_RDONLY, 0);
static void PGresult * res
bool pg_strong_random(void *buf, size_t len)
void pg_strong_random_init(void)