ltc_prng_descriptor

Struct ltc_prng_descriptor 

Source
#[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_char

Name of the PRNG

§export_size: c_int

size 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

Trait Implementations§

Source§

impl Clone for ltc_prng_descriptor

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ltc_prng_descriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for ltc_prng_descriptor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.