Trait cipher::BlockDecryptMut
source · pub trait BlockDecryptMut: BlockSizeUser + Sized {
// Required method
fn decrypt_with_backend_mut(
&mut self,
f: impl BlockClosure<BlockSize = Self::BlockSize>,
);
// Provided methods
fn decrypt_block_inout_mut(&mut self, block: InOut<'_, '_, Block<Self>>) { ... }
fn decrypt_blocks_inout_mut(
&mut self,
blocks: InOutBuf<'_, '_, Block<Self>>,
) { ... }
fn decrypt_block_mut(&mut self, block: &mut Block<Self>) { ... }
fn decrypt_block_b2b_mut(
&mut self,
in_block: &Block<Self>,
out_block: &mut Block<Self>,
) { ... }
fn decrypt_blocks_mut(&mut self, blocks: &mut [Block<Self>]) { ... }
fn decrypt_blocks_b2b_mut(
&mut self,
in_blocks: &[Block<Self>],
out_blocks: &mut [Block<Self>],
) -> Result<(), NotEqualError> { ... }
fn decrypt_padded_inout_mut<'inp, 'out, P: Padding<Self::BlockSize>>(
self,
data: InOutBuf<'inp, 'out, u8>,
) -> Result<&'out [u8], UnpadError> { ... }
fn decrypt_padded_mut<P: Padding<Self::BlockSize>>(
self,
buf: &mut [u8],
) -> Result<&[u8], UnpadError> { ... }
fn decrypt_padded_b2b_mut<'a, P: Padding<Self::BlockSize>>(
self,
in_buf: &[u8],
out_buf: &'a mut [u8],
) -> Result<&'a [u8], UnpadError> { ... }
fn decrypt_padded_vec_mut<P: Padding<Self::BlockSize>>(
self,
buf: &[u8],
) -> Result<Vec<u8>, UnpadError> { ... }
}
Expand description
Decrypt-only functionality for block ciphers and modes with mutable access to self
.
The main use case for this trait is blocks modes, but it also can be used
for hardware cryptographic engines which require &mut self
access to an
underlying hardware peripheral.
Required Methods§
sourcefn decrypt_with_backend_mut(
&mut self,
f: impl BlockClosure<BlockSize = Self::BlockSize>,
)
fn decrypt_with_backend_mut( &mut self, f: impl BlockClosure<BlockSize = Self::BlockSize>, )
Decrypt data using backend provided to the rank-2 closure.
Provided Methods§
sourcefn decrypt_block_inout_mut(&mut self, block: InOut<'_, '_, Block<Self>>)
fn decrypt_block_inout_mut(&mut self, block: InOut<'_, '_, Block<Self>>)
Decrypt single inout
block.
sourcefn decrypt_blocks_inout_mut(&mut self, blocks: InOutBuf<'_, '_, Block<Self>>)
fn decrypt_blocks_inout_mut(&mut self, blocks: InOutBuf<'_, '_, Block<Self>>)
Decrypt inout
blocks.
sourcefn decrypt_block_mut(&mut self, block: &mut Block<Self>)
fn decrypt_block_mut(&mut self, block: &mut Block<Self>)
Decrypt single block in-place.
sourcefn decrypt_block_b2b_mut(
&mut self,
in_block: &Block<Self>,
out_block: &mut Block<Self>,
)
fn decrypt_block_b2b_mut( &mut self, in_block: &Block<Self>, out_block: &mut Block<Self>, )
Decrypt in_block
and write result to out_block
.
sourcefn decrypt_blocks_mut(&mut self, blocks: &mut [Block<Self>])
fn decrypt_blocks_mut(&mut self, blocks: &mut [Block<Self>])
Decrypt blocks in-place.
sourcefn decrypt_blocks_b2b_mut(
&mut self,
in_blocks: &[Block<Self>],
out_blocks: &mut [Block<Self>],
) -> Result<(), NotEqualError>
fn decrypt_blocks_b2b_mut( &mut self, in_blocks: &[Block<Self>], out_blocks: &mut [Block<Self>], ) -> Result<(), NotEqualError>
Decrypt blocks buffer-to-buffer.
Returns NotEqualError
if provided in_blocks
and out_blocks
have different lengths.
sourcefn decrypt_padded_inout_mut<'inp, 'out, P: Padding<Self::BlockSize>>(
self,
data: InOutBuf<'inp, 'out, u8>,
) -> Result<&'out [u8], UnpadError>
fn decrypt_padded_inout_mut<'inp, 'out, P: Padding<Self::BlockSize>>( self, data: InOutBuf<'inp, 'out, u8>, ) -> Result<&'out [u8], UnpadError>
Decrypt input and unpad it. Returns resulting ciphertext slice.
Returns UnpadError
if padding is malformed or if input length is
not multiple of Self::BlockSize
.
sourcefn decrypt_padded_mut<P: Padding<Self::BlockSize>>(
self,
buf: &mut [u8],
) -> Result<&[u8], UnpadError>
fn decrypt_padded_mut<P: Padding<Self::BlockSize>>( self, buf: &mut [u8], ) -> Result<&[u8], UnpadError>
Decrypt input and unpad it in-place. Returns resulting ciphertext slice.
Returns UnpadError
if padding is malformed or if input length is
not multiple of Self::BlockSize
.
sourcefn decrypt_padded_b2b_mut<'a, P: Padding<Self::BlockSize>>(
self,
in_buf: &[u8],
out_buf: &'a mut [u8],
) -> Result<&'a [u8], UnpadError>
fn decrypt_padded_b2b_mut<'a, P: Padding<Self::BlockSize>>( self, in_buf: &[u8], out_buf: &'a mut [u8], ) -> Result<&'a [u8], UnpadError>
Decrypt input and unpad it buffer-to-buffer. Returns resulting ciphertext slice.
Returns UnpadError
if padding is malformed or if input length is
not multiple of Self::BlockSize
.
sourcefn decrypt_padded_vec_mut<P: Padding<Self::BlockSize>>(
self,
buf: &[u8],
) -> Result<Vec<u8>, UnpadError>
fn decrypt_padded_vec_mut<P: Padding<Self::BlockSize>>( self, buf: &[u8], ) -> Result<Vec<u8>, UnpadError>
Decrypt input and unpad it in a newly allocated Vec. Returns resulting ciphertext Vec.
Returns UnpadError
if padding is malformed or if input length is
not multiple of Self::BlockSize
.