Struct bearssl::br_prng_class_
[−]
[src]
#[repr(C)]pub struct br_prng_class_ { pub context_size: usize, pub init: Option<unsafe extern "C" fn(_: *mut *const br_prng_class, _: *const c_void, _: *const c_void, _: usize)>, pub generate: Option<unsafe extern "C" fn(_: *mut *const br_prng_class, _: *mut c_void, _: usize)>, pub update: Option<unsafe extern "C" fn(_: *mut *const br_prng_class, _: *const c_void, _: usize)>, }
Fields
context_size: usize
\brief Size (in bytes) of the context structure appropriate for running this PRNG.
init: Option<unsafe extern "C" fn(_: *mut *const br_prng_class, _: *const c_void, _: *const c_void, _: usize)>
\brief Initialisation method.
The context to initialise is provided as a pointer to its first field (the vtable pointer); this function sets that first field to a pointer to the vtable.
The extra parameters depend on the implementation; each implementation defines what kind of extra parameters it expects (if any).
Requirements on the initial seed depend on the implemented PRNG.
\param ctx PRNG context to initialise. \param params extra parameters for the PRNG. \param seed initial seed. \param seed_len initial seed length (in bytes).
generate: Option<unsafe extern "C" fn(_: *mut *const br_prng_class, _: *mut c_void, _: usize)>
\brief Random bytes generation.
This method produces len
pseudorandom bytes, in the out
buffer. The context is updated accordingly.
\param ctx PRNG context. \param out output buffer. \param len number of pseudorandom bytes to produce.
update: Option<unsafe extern "C" fn(_: *mut *const br_prng_class, _: *const c_void, _: usize)>
\brief Inject additional seed bytes.
The provided seed bytes are added into the PRNG internal entropy pool.
\param ctx PRNG context. \param seed additional seed. \param seed_len additional seed length (in bytes).
Trait Implementations
impl Debug for br_prng_class_
[src]
impl Copy for br_prng_class_
[src]
impl Clone for br_prng_class_
[src]
fn clone(&self) -> br_prng_class_
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more