Symmetric

Struct Symmetric 

Source
pub struct Symmetric<I, T>(/* private fields */);
Expand description

SymmetricNetwork wrapper around an IntoIterator.

Implementations§

Source§

impl<I, T: BitXor<Output = T>> Symmetric<I, T>

Source

pub fn new(rounds: I) -> Self

Make a SymmetricNetwork out of an IntoIterator.

Trait Implementations§

Source§

impl<I: Clone, T> Clone for Symmetric<I, T>

Source§

fn clone(&self) -> Self

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<I: IntoIterator, T> IntoIterator for Symmetric<I, T>

Source§

type Item = <I as IntoIterator>::Item

The type of the elements being iterated over.
Source§

type IntoIter = <I as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T: BitXor<Output = T>, I: IntoIterator<Item: Round<T, L = T>, IntoIter: DoubleEndedIterator>> SymmetricNetwork for Symmetric<I, T>

Source§

type T = T

Half of a block.
Source§

fn swap(block: (Self::T, Self::T)) -> (Self::T, Self::T)

swap(swap(block)) == block
Source§

impl<I: Copy, T> Copy for Symmetric<I, T>

Auto Trait Implementations§

§

impl<I, T> Freeze for Symmetric<I, T>
where I: Freeze,

§

impl<I, T> RefUnwindSafe for Symmetric<I, T>

§

impl<I, T> Send for Symmetric<I, T>
where I: Send, T: Send,

§

impl<I, T> Sync for Symmetric<I, T>
where I: Sync, T: Sync,

§

impl<I, T> Unpin for Symmetric<I, T>
where I: Unpin, T: Unpin,

§

impl<I, T> UnwindSafe for Symmetric<I, T>
where I: UnwindSafe, T: 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, L, R, I> ArrayNetwork for I
where L: ArrayLength + Add<R>, <L as Add<R>>::Output: ArrayLength + Sub<L, Output = R, Output = L> + Sub<R>, R: ArrayLength + Add<L, Output = <L as Add<R>>::Output>, T: BitXor, I: Network<L = XorArray<T, L>, R = XorArray<T, R>>,

Source§

type LN = L

Length of the left half of a block.
Source§

type RN = R

Length of the right half of a block.
Source§

type T = T

Element of an array.
Source§

fn array_encrypt( self, block: GenericArray<<Self as ArrayNetwork>::T, Sum<<Self as ArrayNetwork>::LN, <Self as ArrayNetwork>::RN>>, ) -> GenericArray<<Self as ArrayNetwork>::T, Sum<<Self as ArrayNetwork>::LN, <Self as ArrayNetwork>::RN>>

Encrypt an array.
Source§

fn array_decrypt( self, block: GenericArray<<Self as ArrayNetwork>::T, Sum<<Self as ArrayNetwork>::LN, <Self as ArrayNetwork>::RN>>, ) -> GenericArray<<Self as ArrayNetwork>::T, Sum<<Self as ArrayNetwork>::LN, <Self as ArrayNetwork>::RN>>

Decrypt an array.
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<I> Network for I

Source§

type L = <I as SymmetricNetwork>::T

The left half of a block.
Source§

type R = <I as SymmetricNetwork>::T

The right half of a block.
Source§

fn forward( block: (<I as Network>::R, <I as Network>::L), ) -> (<I as Network>::L, <I as Network>::R)

Rearrange halves coming from hashing and xoring the previous block into the next block. Read more
Source§

fn backward( block: (<I as Network>::L, <I as Network>::R), ) -> (<I as Network>::L, <I as Network>::R)

Inverse of Network::forward.
Source§

fn encrypt(self, block: (Self::L, Self::R)) -> (Self::L, Self::R)

Encrypt a block represented as halves.
Source§

fn decrypt(self, block: (Self::L, Self::R)) -> (Self::L, Self::R)

Decrypt a block represented as halves.
Source§

impl<T> Same for T

Source§

type Output = T

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