53 #include <openssl/rand.h>
80 #define NUM_RAND_POLL_RETRIES 8
82 for (
i = 0;
i < NUM_RAND_POLL_RETRIES;
i++)
84 if (RAND_status() == 1)
93 if (RAND_bytes(
buf,
len) == 1)
100 #include <wincrypt.h>
105 static HCRYPTPROV hProvider = 0;
118 if (!CryptAcquireContext(&hProvider,
122 CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
134 if (CryptGenRandom(hProvider,
len,
buf))
159 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)