#[non_exhaustive]
pub enum Cipher {
None,
Aes256Ctr,
}
Expand description
Cipher algorithms.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
None
No cipher (unencrypted key).
Aes256Ctr
AES-256 in counter (CTR) mode.
Implementations
sourceimpl Cipher
impl Cipher
sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Get the string identifier which corresponds to this algorithm.
sourcepub fn key_and_iv_size(self) -> Option<(usize, usize)>
pub fn key_and_iv_size(self) -> Option<(usize, usize)>
Get the key and IV size for this cipher in bytes.
sourcepub fn block_size(self) -> usize
pub fn block_size(self) -> usize
Get the block size for this cipher in bytes.
sourcepub fn padding_len(self, input_size: usize) -> usize
pub fn padding_len(self, input_size: usize) -> usize
Compute the length of padding necessary to pad the given input to the block size.
Trait Implementations
sourceimpl Ord for Cipher
impl Ord for Cipher
sourceimpl PartialOrd<Cipher> for Cipher
impl PartialOrd<Cipher> for Cipher
sourcefn partial_cmp(&self, other: &Cipher) -> Option<Ordering>
fn partial_cmp(&self, other: &Cipher) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Cipher
impl Eq for Cipher
impl StructuralEq for Cipher
impl StructuralPartialEq for Cipher
Auto Trait Implementations
impl RefUnwindSafe for Cipher
impl Send for Cipher
impl Sync for Cipher
impl Unpin for Cipher
impl UnwindSafe for Cipher
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more