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 CustomSalt with the given mode and salt. The length of salt must be at least the required salt 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) -> AesSalt

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: &AesSalt) -> 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,

fn equivalent(&self, key: &K) -> bool

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

fn equivalent(&self, key: &K) -> bool

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for AesSalt

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Same for AesSalt

type Output = T;

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

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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