10 FILE_LICENCE ( GPL2_OR_LATER );
13 #include <ipxe/drbg.h>
16 struct random_bit_generator {
18 struct drbg_state state;
21 extern struct random_bit_generator rbg;
24 * Generate bits using RBG
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
33 * This is the RBG_Generate function defined in ANS X9.82 Part 4
34 * (April 2011 Draft) Section 9.1.2.2.
36 static inline int rbg_generate ( const void *additional, size_t additional_len,
37 int prediction_resist, void *data,
39 return drbg_generate ( &rbg.state, additional, additional_len,
40 prediction_resist, data, len );
43 #endif /* _IPXE_RBG_H */