1#ifndef _IPXE_HMAC_DRBG_H
2#define _IPXE_HMAC_DRBG_H
23#define HMAC_DRBG( hash, max_security_strength, out_len_bits ) \
24 ( hash, max_security_strength, out_len_bits )
36#define HMAC_DRBG_SHA1 HMAC_DRBG ( &sha1_algorithm, 128, 160 )
48#define HMAC_DRBG_SHA224 HMAC_DRBG ( &sha224_algorithm, 192, 224 )
60#define HMAC_DRBG_SHA256 HMAC_DRBG ( &sha256_algorithm, 256, 256 )
72#define HMAC_DRBG_SHA384 HMAC_DRBG ( &sha384_algorithm, 256, 384 )
84#define HMAC_DRBG_SHA512 HMAC_DRBG ( &sha512_algorithm, 256, 512 )
91#define HMAC_DRBG_HASH( hmac_drbg ) \
92 HMAC_DRBG_EXTRACT_HASH hmac_drbg
93#define HMAC_DRBG_EXTRACT_HASH( hash, max_security_strength, out_len_bits ) \
101#define HMAC_DRBG_MAX_SECURITY_STRENGTH( hmac_drbg ) \
102 HMAC_DRBG_EXTRACT_MAX_SECURITY_STRENGTH hmac_drbg
103#define HMAC_DRBG_EXTRACT_MAX_SECURITY_STRENGTH( hash, max_security_strength, \
105 max_security_strength
112#define HMAC_DRBG_OUTLEN_BITS( hmac_drbg ) \
113 HMAC_DRBG_EXTRACT_OUTLEN_BITS hmac_drbg
114#define HMAC_DRBG_EXTRACT_OUTLEN_BITS( hash, max_security_strength, \
123#define HMAC_DRBG_OUTLEN_BYTES( hmac_drbg ) \
124 ( HMAC_DRBG_OUTLEN_BITS ( hmac_drbg ) / 8 )
132#define HMAC_DRBG_MAX_OUTLEN_BYTES HMAC_DRBG_OUTLEN_BYTES ( HMAC_DRBG_SHA512 )
143#define HMAC_DRBG_MIN_ENTROPY( security_strength ) (security_strength)
154#define HMAC_DRBG_MIN_ENTROPY_LEN_BYTES( security_strength ) \
155 ( (security_strength) / 8 )
165#define HMAC_DRBG_MAX_ENTROPY_LEN_BYTES 32
175#define HMAC_DRBG_MAX_PERSONAL_LEN_BYTES 0xffffffffUL
185#define HMAC_DRBG_MAX_ADDITIONAL_LEN_BYTES 0xffffffffUL
195#define HMAC_DRBG_MAX_GENERATED_LEN_BYTES 0x0000ffffUL
207#define HMAC_DRBG_RESEED_INTERVAL 1024
243 const void *entropy,
size_t entropy_len,
244 const void *personal,
size_t personal_len );
247 const void *entropy,
size_t entropy_len,
248 const void *
additional,
size_t additional_len );
251 const void *
additional,
size_t additional_len,
pseudo_bit_t hash[0x00010]
uint8_t data[48]
Additional event data.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define HMAC_DRBG_MAX_OUTLEN_BYTES
Maximum output block length, in bytes.
int hmac_drbg_generate(struct digest_algorithm *hash, struct hmac_drbg_state *state, const void *additional, size_t additional_len, void *data, size_t len)
Generate pseudorandom bits using HMAC_DRBG.
void hmac_drbg_reseed(struct digest_algorithm *hash, struct hmac_drbg_state *state, const void *entropy, size_t entropy_len, const void *additional, size_t additional_len)
Reseed HMAC_DRBG.
void hmac_drbg_instantiate(struct digest_algorithm *hash, struct hmac_drbg_state *state, const void *entropy, size_t entropy_len, const void *personal, size_t personal_len)
Instantiate HMAC_DRBG.
uint16_t additional
Additional sense code and qualifier.
A message digest algorithm.
HMAC_DRBG internal state.
uint8_t value[HMAC_DRBG_MAX_OUTLEN_BYTES]
Current value.
uint8_t key[HMAC_DRBG_MAX_OUTLEN_BYTES]
Current key.
unsigned int reseed_counter
Reseed counter.