68#ifndef __TC_HMAC_PRNG_H__
69#define __TC_HMAC_PRNG_H__
78#define TC_HMAC_PRNG_RESEED_REQ -1
80struct tc_hmac_prng_struct {
82 struct tc_hmac_state_struct h;
84 uint8_t key[TC_SHA256_DIGEST_SIZE];
86 uint8_t v[TC_SHA256_DIGEST_SIZE];
88 unsigned int countdown;
91typedef struct tc_hmac_prng_struct *TCHmacPrng_t;
116 const uint8_t *personalization,
140 unsigned int seedlen,
const uint8_t *additional_input,
141 unsigned int additionallen);
Interface to an HMAC implementation.
int tc_hmac_prng_init(TCHmacPrng_t prng, const uint8_t *personalization, unsigned int plen)
HMAC-PRNG initialization procedure Initializes prng with personalization, disables tc_hmac_prng_gener...
Definition hmac_prng.c:112
int tc_hmac_prng_generate(uint8_t *out, unsigned int outlen, TCHmacPrng_t prng)
HMAC-PRNG generate procedure Generates outlen pseudo-random bytes into out buffer,...
Definition hmac_prng.c:177
int tc_hmac_prng_reseed(TCHmacPrng_t prng, const uint8_t *seed, unsigned int seedlen, const uint8_t *additional_input, unsigned int additionallen)
HMAC-PRNG reseed procedure Mixes seed into prng, enables tc_hmac_prng_generate.
Definition hmac_prng.c:138
Interface to a SHA-256 implementation.