Struct bearssl::br_block_ctr_class_
[−]
[src]
#[repr(C)]pub struct br_block_ctr_class_ { pub context_size: usize, pub block_size: c_uint, pub log_block_size: c_uint, pub init: Option<unsafe extern "C" fn(_: *mut *const br_block_ctr_class, _: *const c_void, _: usize)>, pub run: Option<unsafe extern "C" fn(_: *const *const br_block_ctr_class, _: *const c_void, _: u32, _: *mut c_void, _: usize) -> u32>, }
Fields
context_size: usize
\brief Size (in bytes) of the context structure appropriate for containing subkeys.
block_size: c_uint
\brief Size of individual blocks (in bytes).
log_block_size: c_uint
\brief Base-2 logarithm of the size of individual blocks, expressed in bytes.
init: Option<unsafe extern "C" fn(_: *mut *const br_block_ctr_class, _: *const c_void, _: usize)>
\brief Initialisation function.
This function sets the vtable
field in the context structure.
The key length MUST be one of the key lengths supported by
the implementation.
\param ctx context structure to initialise. \param key secret key. \param key_len key length (in bytes).
run: Option<unsafe extern "C" fn(_: *const *const br_block_ctr_class, _: *const c_void, _: u32, _: *mut c_void, _: usize) -> u32>
\brief Run the CTR encryption or decryption.
The iv
parameter points to the IV for this run; its
length is exactly 4 bytes less than the block size (e.g.
12 bytes for AES/CTR). The IV is combined with a 32-bit
block counter to produce the block value which is processed
with the block cipher.
The data to encrypt or decrypt is updated "in place". Its
length (len
bytes) is not required to be a multiple of
the block size; if the final block is partial, then the
corresponding key stream bits are dropped.
The resulting counter value is returned.
\param ctx context structure (already initialised). \param iv IV for CTR encryption/decryption. \param cc initial value for the block counter. \param data data to encrypt or decrypt. \param len data length (in bytes). \return the new block counter value.
Trait Implementations
impl Debug for br_block_ctr_class_
[src]
impl Copy for br_block_ctr_class_
[src]
impl Clone for br_block_ctr_class_
[src]
fn clone(&self) -> br_block_ctr_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