Skip to main content

BackendWrapper

Struct BackendWrapper 

Source
struct BackendWrapper<'a, BS: ArraySize, B> {
    backend: &'a B,
    _pd: PhantomData<BS>,
}
Expand description

Wrapper around tweakable block cipher backend which implements non-tweakable block cipher backend traits using zero tweak.

Fields§

§backend: &'a B§_pd: PhantomData<BS>

Trait Implementations§

Source§

impl<BS: ArraySize, B> BlockCipherDecBackend for BackendWrapper<'_, BS, B>
where B: TweakBlockCipherDecBackend<BlockSize = BS>,

Source§

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

Decrypt single inout block.
Source§

fn decrypt_par_blocks(&self, blocks: InOut<'_, '_, ParBlocks<Self>>)

Decrypt inout blocks in parallel.
Source§

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

Decrypt buffer of inout blocks. Length of the buffer MUST be smaller than Self::ParBlocksSize.
Source§

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

Decrypt single block in-place.
Source§

fn decrypt_par_blocks_inplace(&self, blocks: &mut ParBlocks<Self>)

Decrypt blocks in parallel in-place.
Source§

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

Decrypt buffer of blocks in-place. Length of the buffer MUST be smaller than Self::ParBlocksSize.
Source§

impl<BS: ArraySize, B> BlockCipherEncBackend for BackendWrapper<'_, BS, B>
where B: TweakBlockCipherEncBackend<BlockSize = BS>,

Source§

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

Encrypt single inout block.
Source§

fn encrypt_par_blocks(&self, blocks: InOut<'_, '_, ParBlocks<Self>>)

Encrypt inout blocks in parallel.
Source§

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

Encrypt buffer of inout blocks. Length of the buffer MUST be smaller than Self::ParBlocksSize.
Source§

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

Encrypt single block in-place.
Source§

fn encrypt_par_blocks_inplace(&self, blocks: &mut ParBlocks<Self>)

Encrypt blocks in parallel in-place.
Source§

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

Encrypt buffer of blocks in-place. Length of the buffer MUST be smaller than Self::ParBlocksSize.
Source§

impl<BS: ArraySize, B> BlockSizeUser for BackendWrapper<'_, BS, B>

Source§

type BlockSize = BS

Size of the block in bytes.
Source§

fn block_size() -> usize

Return block size in bytes.
Source§

impl<BS: ArraySize, B> ParBlocksSizeUser for BackendWrapper<'_, BS, B>

Source§

type ParBlocksSize = UInt<UTerm, B1>

Number of blocks which can be processed in parallel.

Auto Trait Implementations§

§

impl<'a, BS, B> Freeze for BackendWrapper<'a, BS, B>

§

impl<'a, BS, B> RefUnwindSafe for BackendWrapper<'a, BS, B>

§

impl<'a, BS, B> Send for BackendWrapper<'a, BS, B>
where B: Sync, BS: Send,

§

impl<'a, BS, B> Sync for BackendWrapper<'a, BS, B>
where B: Sync, BS: Sync,

§

impl<'a, BS, B> Unpin for BackendWrapper<'a, BS, B>
where BS: Unpin,

§

impl<'a, BS, B> UnsafeUnpin for BackendWrapper<'a, BS, B>

§

impl<'a, BS, B> UnwindSafe for BackendWrapper<'a, BS, B>
where B: RefUnwindSafe, BS: 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> 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.