Struct SymmetricState

Source
pub struct SymmetricState<C, K>
where C: Config,
{ /* private fields */ }

Implementations§

Source§

impl<C> SymmetricState<C, ChainingKey<C>>
where C: Config,

Source

pub fn new(name: &str) -> Self

Source§

impl<C, K> SymmetricState<C, K>
where C: Config,

Source

pub fn hash(&self) -> GenericArray<u8, <<C as Config>::MixHash as MixHash>::L>

Source

pub fn mix_hash(self, data: &[u8]) -> Self

Source§

impl<C, K> SymmetricState<C, K>
where C: Config, K: Into<ChainingKey<C>>,

Source

pub fn mix_shared_secret<S>(self, data: S) -> SymmetricState<C, Key<C, U0>>
where S: AsRef<[u8]> + Zeroize,

Source

pub fn mix_psk<S>(self, data: S) -> SymmetricState<C, Key<C, U0>>
where S: AsRef<[u8]> + Zeroize,

Source

pub fn finish_raw<const STEP: u64, const SWAP: bool>(self) -> OutputRaw<C>

Source

pub fn finish<const STEP: u64, const SWAP: bool>(self) -> Output<C, STEP>

Source§

impl<C, N> SymmetricState<C, Key<C, N>>
where C: ConfigExt, N: Unsigned + Add<U1>, <N as Add<U1>>::Output: Unsigned,

Source

pub fn unsafe_set_hash( self, hash: GenericArray<u8, <<C as Config>::MixHash as MixHash>::L>, ) -> Self

Source

pub fn increase(self) -> SymmetricState<C, Key<C, <N as Add<U1>>::Output>>

Source

pub fn zeros_tag<const L: usize>( self, zeros: &mut [u8; L], ) -> (SymmetricState<C, Key<C, <N as Add<U1>>::Output>>, Tag<C>)

§Panics

when zeros slice is too long (gigabytes)

Source

pub fn encrypt( self, data: &mut [u8], ) -> (SymmetricState<C, Key<C, <N as Add<U1>>::Output>>, Tag<C>)

§Panics

when data slice is too long (gigabytes)

Source

pub fn encrypt_ext( self, data: &mut Vec<u8>, ) -> SymmetricState<C, Key<C, <N as Add<U1>>::Output>>

Source

pub fn decrypt( self, data: &mut [u8], tag: &Tag<C>, ) -> Result<SymmetricState<C, Key<C, <N as Add<U1>>::Output>>, MacMismatch>

§Errors

mac mismatch

Trait Implementations§

Source§

impl<C, K: Clone> Clone for SymmetricState<C, K>
where C: Config + Clone,

Source§

fn clone(&self) -> SymmetricState<C, K>

Returns a duplicate 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<C> Debug for SymmetricState<C, ChainingKey<C>>
where C: Config,

Source§

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

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

impl<'de, C> Deserialize<'de> for SymmetricState<C, ChainingKey<C>>
where C: Config,

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<C> Serialize for SymmetricState<C, ChainingKey<C>>
where C: Config,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<C, K> Freeze for SymmetricState<C, K>
where K: Freeze, <<<C as Config>::MixHash as MixHash>::L as ArrayLength<u8>>::ArrayType: Freeze,

§

impl<C, K> RefUnwindSafe for SymmetricState<C, K>
where K: RefUnwindSafe, <<<C as Config>::MixHash as MixHash>::L as ArrayLength<u8>>::ArrayType: RefUnwindSafe,

§

impl<C, K> Send for SymmetricState<C, K>
where K: Send,

§

impl<C, K> Sync for SymmetricState<C, K>
where K: Sync,

§

impl<C, K> Unpin for SymmetricState<C, K>
where K: Unpin, <<<C as Config>::MixHash as MixHash>::L as ArrayLength<u8>>::ArrayType: Unpin,

§

impl<C, K> UnwindSafe for SymmetricState<C, K>
where K: UnwindSafe, <<<C as Config>::MixHash as MixHash>::L as ArrayLength<u8>>::ArrayType: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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, 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,