#[repr(C)]pub struct ltc_prng_descriptor {
pub name: *const c_char,
pub export_size: c_int,
pub start: Option<unsafe extern "C" fn(prng: *mut prng_state) -> c_int>,
pub add_entropy: Option<unsafe extern "C" fn(in_: *const c_uchar, inlen: c_ulong, prng: *mut prng_state) -> c_int>,
pub ready: Option<unsafe extern "C" fn(prng: *mut prng_state) -> c_int>,
pub read: Option<unsafe extern "C" fn(out: *mut c_uchar, outlen: c_ulong, prng: *mut prng_state) -> c_ulong>,
pub done: Option<unsafe extern "C" fn(prng: *mut prng_state) -> c_int>,
pub pexport: Option<unsafe extern "C" fn(out: *mut c_uchar, outlen: *mut c_ulong, prng: *mut prng_state) -> c_int>,
pub pimport: Option<unsafe extern "C" fn(in_: *const c_uchar, inlen: c_ulong, prng: *mut prng_state) -> c_int>,
pub test: Option<unsafe extern "C" fn() -> c_int>,
}Expand description
PRNG descriptor
Fields§
§name: *const c_charName of the PRNG
export_size: c_intsize in bytes of exported state
start: Option<unsafe extern "C" fn(prng: *mut prng_state) -> c_int>Start a PRNG state @param prng [out] The state to initialize @return CRYPT_OK if successful
add_entropy: Option<unsafe extern "C" fn(in_: *const c_uchar, inlen: c_ulong, prng: *mut prng_state) -> c_int>Add entropy to the PRNG
@param in The entropy
@param inlen Length of the entropy (octets)
@param prng The PRNG state
@return CRYPT_OK if successful
ready: Option<unsafe extern "C" fn(prng: *mut prng_state) -> c_int>Ready a PRNG state to read from @param prng The PRNG state to ready @return CRYPT_OK if successful
read: Option<unsafe extern "C" fn(out: *mut c_uchar, outlen: c_ulong, prng: *mut prng_state) -> c_ulong>Read from the PRNG @param out [out] Where to store the data @param outlen Length of data desired (octets) @param prng The PRNG state to read from @return Number of octets read
done: Option<unsafe extern "C" fn(prng: *mut prng_state) -> c_int>Terminate a PRNG state @param prng The PRNG state to terminate @return CRYPT_OK if successful
pexport: Option<unsafe extern "C" fn(out: *mut c_uchar, outlen: *mut c_ulong, prng: *mut prng_state) -> c_int>Export a PRNG state @param out [out] The destination for the state @param outlen [in/out] The max size and resulting size of the PRNG state @param prng The PRNG to export @return CRYPT_OK if successful
pimport: Option<unsafe extern "C" fn(in_: *const c_uchar, inlen: c_ulong, prng: *mut prng_state) -> c_int>Import a PRNG state @param in The data to import @param inlen The length of the data to import (octets) @param prng The PRNG to initialize/import @return CRYPT_OK if successful
test: Option<unsafe extern "C" fn() -> c_int>Self-test the PRNG @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled