Enum AesSalt

pub enum AesSalt

A custom salt that can be used instead of a randomly generated one when encrypting files with AES. This is not recommended, but it can be useful for testing or for reproducible encryption results.

Variants

Aes128([u8; 8])

AES 128 salt

Aes192([u8; 12])

AES 192 salt

Aes256([u8; 16])

AES 256 salt

Implementations

impl AesSalt

fn try_new(mode: AesMode, salt: &[u8]) -> Result<Self, Error>

Creates a new AesSalt with the given mode and salt. The length of salt must be exactly one-half the key length for the given mode, otherwise an error is returned.

Errors

Returns an error if the length of salt is too short for the given mode.

Trait Implementations

impl Clone for AesSalt

fn clone(&self) -> Self

impl Copy for AesSalt

impl Debug for AesSalt

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

impl Eq for AesSalt

impl PartialEq for AesSalt

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

impl StructuralPartialEq for AesSalt

Auto Trait Implementations

impl Freeze for AesSalt

impl RefUnwindSafe for AesSalt

impl Send for AesSalt

impl Sync for AesSalt

impl Unpin for AesSalt

impl UnsafeUnpin for AesSalt

impl UnwindSafe for AesSalt

Blanket Implementations

impl<Q, K> Equivalent<K> for AesSalt where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

impl<Q, K> Equivalent<K> for AesSalt where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

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

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

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

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

impl<T> From<T> for AesSalt

impl<T> Same for AesSalt

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

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

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

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