#[non_exhaustive]pub enum BlockCipherMode {
CFB,
CBC,
ECB,
}Expand description
Block cipher mode of operation.
Block modes govern how a block cipher processes data spanning multiple blocks.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
CFB
Full-block cipher feedback mode.
CBC
Cipher block chaining.
ECB
Electronic codebook mode.
Note: do not use as-is. Patterns in the plaintext will be visible as patterns in the ciphertext. Mind the penguin!
Implementations§
Source§impl BlockCipherMode
impl BlockCipherMode
Sourcepub fn requires_padding(&self) -> bool
pub fn requires_padding(&self) -> bool
Returns whether the mode requires padding.
Some modes only operate on complete blocks, so if the plaintext’s length is not a multiple of the symmetric algorithm’s block size, padding is required.
Trait Implementations§
Source§impl Clone for BlockCipherMode
impl Clone for BlockCipherMode
Source§fn clone(&self) -> BlockCipherMode
fn clone(&self) -> BlockCipherMode
Returns a duplicate 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 BlockCipherMode
impl Debug for BlockCipherMode
Source§impl Hash for BlockCipherMode
impl Hash for BlockCipherMode
Source§impl PartialEq for BlockCipherMode
impl PartialEq for BlockCipherMode
impl Copy for BlockCipherMode
impl Eq for BlockCipherMode
impl StructuralPartialEq for BlockCipherMode
Auto Trait Implementations§
impl Freeze for BlockCipherMode
impl RefUnwindSafe for BlockCipherMode
impl Send for BlockCipherMode
impl Sync for BlockCipherMode
impl Unpin for BlockCipherMode
impl UnwindSafe for BlockCipherMode
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