29 #if HAVE_CRYPTGENRANDOM
56 err = read(fd, dst,
sizeof(*dst));
68 struct AVSHA *sha = (
void*)tmp;
70 static uint64_t i = 0;
71 static uint32_t
buffer[512] = { 0 };
72 unsigned char digest[20];
78 memset(buffer, 0,
sizeof(buffer));
93 buffer[++i & 511] += (t - last_t) % 3294638521
U;
94 if (last_i && i - last_i > 4 || i - last_i > 64 ||
TEST && i - last_i > 8)
101 buffer[0] = buffer[1] = 0;
113 #if HAVE_CRYPTGENRANDOM
115 if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
116 CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
117 BOOL ret = CryptGenRandom(provider,
sizeof(seed), (PBYTE) &seed);
118 CryptReleaseContext(provider, 0);
124 if (
read_random(&seed,
"/dev/urandom") ==
sizeof(seed))
126 if (
read_random(&seed,
"/dev/random") ==
sizeof(seed))
141 for (retry=0; retry<3; retry++){
145 if (seeds[j] == seeds[i])
148 printf(
"seeds OK\n");
152 printf(
"FAIL at %d with %X\n", j, seeds[j]);