26 #if HAVE_CRYPTGENRANDOM
48 err = read(fd, dst,
sizeof(*dst));
61 static uint64_t i = 0;
62 static uint32_t
buffer[512] = { 0 };
63 unsigned char digest[20];
72 buffer[++i & 511] += (t - last_t) % 3294638521
U;
73 if (last_i && i - last_i > 4 || i - last_i > 64)
84 for (j = 0; j < 512; j++)
99 #if HAVE_CRYPTGENRANDOM
101 if (CryptAcquireContext(&provider,
NULL,
NULL, PROV_RSA_FULL,
102 CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
103 BOOL ret = CryptGenRandom(provider,
sizeof(seed), (PBYTE) &seed);
104 CryptReleaseContext(provider, 0);
110 if (
read_random(&seed,
"/dev/urandom") ==
sizeof(seed))
112 if (
read_random(&seed,
"/dev/random") ==
sizeof(seed))
void av_sha_final(AVSHA *ctx, uint8_t *digest)
Finish hashing and output digest value.
void av_sha_update(AVSHA *ctx, const uint8_t *data, unsigned int len)
Update hash value.
static int read_random(uint32_t *dst, const char *file)
av_cold int av_sha_init(AVSHA *ctx, int bits)
Initialize SHA-1 or SHA-2 hashing.
memory handling functions
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
static uint32_t get_generic_seed(void)
high precision timer, useful to profile code
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
common internal API header
static void close(AVCodecParserContext *s)
struct AVSHA * av_sha_alloc(void)
Allocate an AVSHA context.
static BOOL(WINAPI *cond_wait)(pthread_cond_t *cond
uint32_t av_get_random_seed(void)
Get random data.