Data Structures | Functions | Variables
rbg.h File Reference

RBG mechanism. More...

#include <stdint.h>
#include <ipxe/drbg.h>

Go to the source code of this file.

Data Structures

struct  random_bit_generator
 An RBG. More...


static int rbg_generate (const void *additional, size_t additional_len, int prediction_resist, void *data, size_t len)
 Generate bits using RBG. More...


struct random_bit_generator rbg
 The RBG. More...

Detailed Description

RBG mechanism.

Definition in file rbg.h.

Function Documentation



◆ rbg_generate()

static int rbg_generate ( const void *  additional,
size_t  additional_len,
int  prediction_resist,
void *  data,
size_t  len 

Generate bits using RBG.

additionalAdditional input
additional_lenLength of additional input
prediction_resistPrediction resistance is required
dataOutput buffer
lenLength of output buffer
Return values
rcReturn status code

This is the RBG_Generate function defined in ANS X9.82 Part 4 (April 2011 Draft) Section

Definition at line 36 of file rbg.h.

38  {
39  return drbg_generate ( &rbg.state, additional, additional_len,
40  prediction_resist, data, len );
41 }
uint16_t additional
Additional sense code and qualifier.
Definition: scsi.h:28
uint32_t len
Definition: ena.h:14
uint8_t data[48]
Additional event data.
Definition: ena.h:22
struct random_bit_generator rbg
The RBG.
Definition: rbg.c:63
struct drbg_state state
DRBG state.
Definition: rbg.h:18
int drbg_generate(struct drbg_state *state, const void *additional, size_t additional_len, int prediction_resist, void *data, size_t len)
Generate pseudorandom bits using DRBG.
Definition: drbg.c:283

References additional, data, drbg_generate(), len, rbg, and random_bit_generator::state.

Referenced by get_random_nz(), tls_generate_random(), and wpa_handle_1_of_4().

Variable Documentation

◆ rbg

The RBG.

Definition at line 63 of file rbg.c.

Referenced by rbg_generate(), rbg_shutdown(), and rbg_startup().