iPXE
rbg.h
Go to the documentation of this file.
1 #ifndef _IPXE_RBG_H
2 #define _IPXE_RBG_H
3 
4 /** @file
5  *
6  * RBG mechanism
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <stdint.h>
13 #include <ipxe/drbg.h>
14 
15 /** An RBG */
17  /** DRBG state */
18  struct drbg_state state;
19 };
20 
21 extern struct random_bit_generator rbg;
22 
23 /**
24  * Generate bits using RBG
25  *
26  * @v additional Additional input
27  * @v additional_len Length of additional input
28  * @v prediction_resist Prediction resistance is required
29  * @v data Output buffer
30  * @v len Length of output buffer
31  * @ret rc Return status code
32  *
33  * This is the RBG_Generate function defined in ANS X9.82 Part 4
34  * (April 2011 Draft) Section 9.1.2.2.
35  */
36 static inline int rbg_generate ( const void *additional, size_t additional_len,
37  int prediction_resist, void *data,
38  size_t len ) {
39  return drbg_generate ( &rbg.state, additional, additional_len,
40  prediction_resist, data, len );
41 }
42 
43 #endif /* _IPXE_RBG_H */
DRBG mechanism.
static int rbg_generate(const void *additional, size_t additional_len, int prediction_resist, void *data, size_t len)
Generate bits using RBG.
Definition: rbg.h:36
A Deterministic Random Bit Generator.
Definition: drbg.h:49
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
An RBG.
Definition: rbg.h:16
uint16_t additional
Additional sense code and qualifier.
Definition: scsi.h:28
uint32_t len
Length.
Definition: ena.h:14
struct random_bit_generator rbg
The RBG.
Definition: rbg.c:63
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
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