56 err = read(fd, dst,
sizeof(*dst));
72 static uint64_t
i = 0;
73 static uint32_t
buffer[512] = { 0 };
74 unsigned char digest[20];
91 if (last_t + 2*last_td + (CLOCKS_PER_SEC > 1000) >= t) {
93 buffer[
i & 511] = 1664525*
buffer[
i & 511] + 1013904223 + (last_td % 3294638521U);
96 buffer[++
i & 511] += last_td % 3294638521U;
97 if ((t - init_t) >= CLOCKS_PER_SEC>>5)
98 if (last_i &&
i - last_i > 4 ||
i - last_i > 64 ||
TEST &&
i - last_i > 8)
125 BCRYPT_ALG_HANDLE algo_handle;
126 NTSTATUS ret = BCryptOpenAlgorithmProvider(&algo_handle, BCRYPT_RNG_ALGORITHM,
127 MS_PRIMITIVE_PROVIDER, 0);
128 if (BCRYPT_SUCCESS(ret)) {
129 NTSTATUS ret = BCryptGenRandom(algo_handle, (UCHAR*)&
seed,
sizeof(
seed), 0);
130 BCryptCloseAlgorithmProvider(algo_handle, 0);
131 if (BCRYPT_SUCCESS(ret))
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
void av_sha_update(struct AVSHA *ctx, const uint8_t *data, unsigned int len)
Update hash value.
void av_sha_final(AVSHA *ctx, uint8_t *digest)
Finish hashing and output digest value.
av_cold int av_sha_init(AVSHA *ctx, int bits)
Initialize SHA-1 or SHA-2 hashing.
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
common internal API header
static uint32_t get_generic_seed(void)
static int read_random(uint32_t *dst, const char *file)
Public header for SHA-1 & SHA-256 hash function implementations.