pub struct RC5ControlBlock<W: Word> { /* private fields */ }Expand description
Implementations§
Source§impl<W: Word> RC5ControlBlock<W>
impl<W: Word> RC5ControlBlock<W>
Sourcepub fn new<K>(key: K, rounds: usize) -> Result<Self, Reason>
pub fn new<K>(key: K, rounds: usize) -> Result<Self, Reason>
RC5 constructor method
It creates an instance of an RC5 control block from raw key and rounds.
Returns a result type containing the control block.
pub fn rounds(&self) -> usize
Sourcepub fn parametric_version(&self) -> String
pub fn parametric_version(&self) -> String
Returns a string describing the parametric RC5 version,
e.g. "RC5-32/12/16".
Trait Implementations§
Source§impl<W: Word> BlockCipher<W, 2> for RC5ControlBlock<W>
impl<W: Word> BlockCipher<W, 2> for RC5ControlBlock<W>
Source§fn encrypt(&self, pt: [W; 2]) -> [W; 2]
fn encrypt(&self, pt: [W; 2]) -> [W; 2]
Raw encryption, encrypt a single
[W;N] block. Read moreSource§fn decrypt(&self, ct: [W; 2]) -> [W; 2]
fn decrypt(&self, ct: [W; 2]) -> [W; 2]
Raw decryption, decrypt a single
[W;N] block. Read moreSource§fn generate_blocks(&self, pt: Vec<u8>) -> Vec<[W; 2]>
fn generate_blocks(&self, pt: Vec<u8>) -> Vec<[W; 2]>
Split a byte‐vector into a
Vec of length-N word blocks.
More generally, it creates a list of blocks from a stream of
plain bytes.Source§fn generate_bytes_stream(&self, blocks: Vec<[W; 2]>) -> Vec<u8> ⓘ
fn generate_bytes_stream(&self, blocks: Vec<[W; 2]>) -> Vec<u8> ⓘ
Generates a stream of bytes from a list of blocks. More
specefically from
N word blocks list generates byte-vector.
Its counterfiet of generate_blocks method.Source§fn control_block_version(&self) -> String
fn control_block_version(&self) -> String
Human‐readable version tag, mostly a parametric version.
e.g. in RC5-block-cipher “RC5-32/12/16”.
Source§fn block_size(&self) -> usize
fn block_size(&self) -> usize
Base block-size in bytes for a block-cipher.
Auto Trait Implementations§
impl<W> Freeze for RC5ControlBlock<W>
impl<W> RefUnwindSafe for RC5ControlBlock<W>where
W: RefUnwindSafe,
impl<W> Send for RC5ControlBlock<W>where
W: Send,
impl<W> Sync for RC5ControlBlock<W>where
W: Sync,
impl<W> Unpin for RC5ControlBlock<W>where
W: Unpin,
impl<W> UnsafeUnpin for RC5ControlBlock<W>
impl<W> UnwindSafe for RC5ControlBlock<W>where
W: UnwindSafe,
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