66 DBGC ( &
efirng,
"EFIRNG has no RNG protocol\n" );
98 DBGC ( &
efirng,
"ENTROPY could not read from RNG: %s\n",
108 *noise =
crc32_le ( 0, buf,
sizeof ( buf ) );
EFI_RNG_PROTOCOL as defined in UEFI 2.4.
struct arbelprm_rc_send_wqe rc
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
#define ENTROPY_NORMAL
Normal entropy source.
struct entropy_source efirng_entropy __entropy_source(ENTROPY_NORMAL)
EFI random number generator protocol entropy source.
#define EFIRNG_LEN
Minimum number of bytes to request from RNG.
The Random Number Generator (RNG) protocol provides random bits for use in applications,...
#define ENOTSUP
Operation not supported.
u32 crc32_le(u32 seed, const void *data, size_t len)
Calculate 32-bit little-endian CRC checksum.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
char * strerror(int errno)
Retrieve string representation of error number.
#define MIN_ENTROPY(bits)
Construct a min-entropy fixed-point value.
static int efirng_get_noise(noise_sample_t *noise)
Get noise sample from RNG protocol.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
EFI_REQUEST_PROTOCOL(EFI_RNG_PROTOCOL, &efirng)
uint8_t noise_sample_t
A noise sample.
static EFI_RNG_PROTOCOL * efirng
Random number generator protocol.
static int efirng_enable(void)
Enable entropy gathering.
static void entropy_init(struct entropy_source *source, min_entropy_t min_entropy_per_sample)
Initialise entropy source.
#define NULL
NULL pointer (VOID *)