ZeroTweak

Struct ZeroTweak 

Source
pub struct ZeroTweak<C: TweakSizeUser + BlockSizeUser>(pub C);
Expand description

Wrapper around tweakable block cipher which implements the common block cipher traits using zero tweak.

Tuple Fields§

§0: C

Trait Implementations§

Source§

impl<C: TweakBlockCipherDecrypt> BlockCipherDecrypt for ZeroTweak<C>

Source§

fn decrypt_with_backend( &self, f: impl BlockCipherDecClosure<BlockSize = Self::BlockSize>, )

Decrypt data using backend provided to the rank-2 closure.
Source§

fn decrypt_block_inout(&self, block: InOut<'_, '_, Block<Self>>)

Decrypt single inout block.
Source§

fn decrypt_blocks_inout(&self, blocks: InOutBuf<'_, '_, Block<Self>>)

Decrypt inout blocks.
Source§

fn decrypt_block(&self, block: &mut Block<Self>)

Decrypt single block in-place.
Source§

fn decrypt_block_b2b(&self, in_block: &Block<Self>, out_block: &mut Block<Self>)

Decrypt in_block and write result to out_block.
Source§

fn decrypt_blocks(&self, blocks: &mut [Block<Self>])

Decrypt blocks in-place.
Source§

fn decrypt_blocks_b2b( &self, in_blocks: &[Block<Self>], out_blocks: &mut [Block<Self>], ) -> Result<(), NotEqualError>

Decrypt blocks buffer-to-buffer. Read more
Source§

impl<C: TweakBlockCipherEncrypt> BlockCipherEncrypt for ZeroTweak<C>

Source§

fn encrypt_with_backend( &self, f: impl BlockCipherEncClosure<BlockSize = Self::BlockSize>, )

Encrypt data using backend provided to the rank-2 closure.
Source§

fn encrypt_block_inout(&self, block: InOut<'_, '_, Block<Self>>)

Encrypt single inout block.
Source§

fn encrypt_blocks_inout(&self, blocks: InOutBuf<'_, '_, Block<Self>>)

Encrypt inout blocks.
Source§

fn encrypt_block(&self, block: &mut Block<Self>)

Encrypt single block in-place.
Source§

fn encrypt_block_b2b(&self, in_block: &Block<Self>, out_block: &mut Block<Self>)

Encrypt in_block and write result to out_block.
Source§

fn encrypt_blocks(&self, blocks: &mut [Block<Self>])

Encrypt blocks in-place.
Source§

fn encrypt_blocks_b2b( &self, in_blocks: &[Block<Self>], out_blocks: &mut [Block<Self>], ) -> Result<(), NotEqualError>

Encrypt blocks buffer-to-buffer. Read more
Source§

impl<C: TweakSizeUser + BlockSizeUser> BlockSizeUser for ZeroTweak<C>

Source§

type BlockSize = <C as BlockSizeUser>::BlockSize

Size of the block in bytes.
Source§

fn block_size() -> usize

Return block size in bytes.
Source§

impl<C: Clone + TweakSizeUser + BlockSizeUser> Clone for ZeroTweak<C>

Source§

fn clone(&self) -> ZeroTweak<C>

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 + TweakSizeUser + BlockSizeUser> Debug for ZeroTweak<C>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<C> Freeze for ZeroTweak<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for ZeroTweak<C>
where C: RefUnwindSafe,

§

impl<C> Send for ZeroTweak<C>
where C: Send,

§

impl<C> Sync for ZeroTweak<C>
where C: Sync,

§

impl<C> Unpin for ZeroTweak<C>
where C: Unpin,

§

impl<C> UnwindSafe for ZeroTweak<C>
where C: 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, 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.