Enum Cipher

Source
pub enum Cipher {
    None,
    Aes128Ctr,
    Aes192Ctr,
    Aes256Ctr,
    Aes128Gcm,
    Aes192Gcm,
    Aes256Gcm,
}
Expand description

Supported cipher algorithms.

Variants§

§

None

No encryption.

§

Aes128Ctr

AES with a 128-bit key in CTR mode

§

Aes192Ctr

AES with a 192-bit key in CTR mode

§

Aes256Ctr

AES with a 256-bit key in CTR mode

§

Aes128Gcm

AES with a 128-bit key in GCM mode

§

Aes192Gcm

AES with a 192-bit key in GCM mode

§

Aes256Gcm

AES with a 256-bit key in GCM mode

Implementations§

Source§

impl Cipher

Source

pub fn block_size(&self) -> usize

Returns the block size of the cipher.

Source

pub fn key_len(&self) -> usize

Returns the key size of the cipher.

Source

pub fn iv_len(&self) -> usize

Returns the IV size of the cipher.

Source

pub fn tag_size(&self) -> u32

Returns the tag size of the cipher.

An AE-cipher results into a

  1. ciphertext
  2. tag

Ciphertext and tag are both stored in a block of the container. Use this method to get the size of the tag. For a non-AE-cipher the tag-size is 0.

Trait Implementations§

Source§

impl Clone for Cipher

Source§

fn clone(&self) -> Cipher

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Cipher

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Cipher

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromStr for Cipher

Source§

type Err = ()

The associated error which can be returned from parsing.
Source§

fn from_str(str: &str) -> Result<Self, ()>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for Cipher

Source§

fn eq(&self, other: &Cipher) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Cipher

Source§

impl StructuralPartialEq for Cipher

Auto Trait Implementations§

§

impl Freeze for Cipher

§

impl RefUnwindSafe for Cipher

§

impl Send for Cipher

§

impl Sync for Cipher

§

impl Unpin for Cipher

§

impl UnwindSafe for Cipher

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.