53 #include <openssl/opensslv.h>
54 #include <openssl/rand.h>
59 #if (OPENSSL_VERSION_NUMBER < 0x10101000L)
83 #define NUM_RAND_POLL_RETRIES 8
85 for (
i = 0;
i < NUM_RAND_POLL_RETRIES;
i++)
87 if (RAND_status() == 1)
96 if (RAND_bytes(
buf,
len) == 1)
103 #include <wincrypt.h>
108 static HCRYPTPROV hProvider = 0;
121 if (!CryptAcquireContext(&hProvider,
125 CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
137 if (CryptGenRandom(hProvider,
len,
buf))
162 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)