#[repr(C)]pub struct cipher_interface_st {
pub block_size: u8,
pub init: Option<unsafe extern "C" fn(ctx: *mut cipher_context_t, key: *const u8, key_size: u8) -> c_int>,
pub encrypt: Option<unsafe extern "C" fn(ctx: *const cipher_context_t, plain_block: *const u8, cipher_block: *mut u8) -> c_int>,
pub decrypt: Option<unsafe extern "C" fn(ctx: *const cipher_context_t, cipher_block: *const u8, plain_block: *mut u8) -> c_int>,
}
Expand description
@brief BlockCipher-Interface for the Cipher-Algorithms
Fields§
§block_size: u8
@brief Blocksize of this cipher
init: Option<unsafe extern "C" fn(ctx: *mut cipher_context_t, key: *const u8, key_size: u8) -> c_int>
@brief the init function.
This function is responsible for checking that the given key_size is valid for the chosen cipher.
encrypt: Option<unsafe extern "C" fn(ctx: *const cipher_context_t, plain_block: *const u8, cipher_block: *mut u8) -> c_int>
@brief the encrypt function
decrypt: Option<unsafe extern "C" fn(ctx: *const cipher_context_t, cipher_block: *const u8, plain_block: *mut u8) -> c_int>
@brief the decrypt function
Trait Implementations§
source§impl Clone for cipher_interface_st
impl Clone for cipher_interface_st
source§fn clone(&self) -> cipher_interface_st
fn clone(&self) -> cipher_interface_st
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for cipher_interface_st
impl Debug for cipher_interface_st
source§impl Default for cipher_interface_st
impl Default for cipher_interface_st
source§fn default() -> cipher_interface_st
fn default() -> cipher_interface_st
Returns the “default value” for a type. Read more
impl Copy for cipher_interface_st
Auto Trait Implementations§
impl Freeze for cipher_interface_st
impl RefUnwindSafe for cipher_interface_st
impl Send for cipher_interface_st
impl Sync for cipher_interface_st
impl Unpin for cipher_interface_st
impl UnwindSafe for cipher_interface_st
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes