|
iPXE
|
RBG mechanism. More...
#include <stdint.h>#include <string.h>#include <ipxe/init.h>#include <ipxe/settings.h>#include <ipxe/uuid.h>#include <ipxe/crypto.h>#include <ipxe/drbg.h>#include <ipxe/rbg.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static int | rbg_startup (void) |
| Start up RBG. More... | |
| int | rbg_generate (const void *additional, size_t additional_len, int prediction_resist, void *data, size_t len) |
| Generate bits using RBG. More... | |
| static void | rbg_shutdown (void) |
| Shut down RBG. More... | |
| static void | rbg_startup_fn (void) |
| RBG startup function. More... | |
| static void | rbg_shutdown_fn (int booting __unused) |
| RBG shutdown function. More... | |
| struct startup_fn startup_rbg | __startup_fn (STARTUP_NORMAL) |
| RBG startup table entry. More... | |
Variables | |
| struct random_bit_generator | rbg |
| The RBG. More... | |
RBG mechanism.
This mechanism is designed to comply with ANS X9.82 Part 4 (April 2011 Draft) Section 10. This standard is unfortunately not freely available.
The chosen RBG design is that of a DRBG with a live entropy source with no conditioning function. Only a single security strength is supported. No seedfile is used since there may be no non-volatile storage available. The system UUID is used as the personalisation string.
Definition in file rbg.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Start up RBG.
| rc | Return status code |
This is the RBG_Startup function defined in ANS X9.82 Part 4 (April 2011 Draft) Section 9.1.2.2.
Definition at line 73 of file rbg.c.
References DBGC, drbg_instantiate(), fetch_uuid_setting(), len, NULL, rbg, rc, random_bit_generator::started, random_bit_generator::state, and strerror().
Referenced by rbg_generate(), and rbg_startup_fn().
| int rbg_generate | ( | const void * | additional, |
| size_t | additional_len, | ||
| int | prediction_resist, | ||
| void * | data, | ||
| size_t | len | ||
| ) |
Generate bits using RBG.
| additional | Additional input |
| additional_len | Length of additional input |
| prediction_resist | Prediction resistance is required |
| data | Output buffer |
| len | Length of output buffer |
| rc | Return status code |
This is the RBG_Generate function defined in ANS X9.82 Part 4 (April 2011 Draft) Section 9.1.2.2.
Definition at line 116 of file rbg.c.
References additional, data, drbg_generate(), len, rbg, rbg_startup(), random_bit_generator::started, and random_bit_generator::state.
Referenced by get_random_nz(), tls_generate_random(), and wpa_handle_1_of_4().
|
static |
Shut down RBG.
Definition at line 134 of file rbg.c.
References drbg_uninstantiate(), rbg, random_bit_generator::started, and random_bit_generator::state.
Referenced by rbg_shutdown_fn().
|
static |
RBG startup function.
Definition at line 144 of file rbg.c.
References rbg, rbg_startup(), and random_bit_generator::started.
|
static |
| struct startup_fn startup_rbg __startup_fn | ( | STARTUP_NORMAL | ) |
RBG startup table entry.
| struct random_bit_generator rbg |
The RBG.
Definition at line 63 of file rbg.c.
Referenced by rbg_generate(), rbg_shutdown(), rbg_startup(), and rbg_startup_fn().
1.8.15