pub trait BlockEncryptMut: BlockSizeUser + Sized {
// Required method
fn encrypt_with_backend_mut(
&mut self,
f: impl BlockClosure<BlockSize = Self::BlockSize>,
);
// Provided methods
fn encrypt_block_inout_mut(&mut self, block: InOut<'_, '_, Block<Self>>) { ... }
fn encrypt_blocks_inout_mut(
&mut self,
blocks: InOutBuf<'_, '_, Block<Self>>,
) { ... }
fn encrypt_block_mut(&mut self, block: &mut Block<Self>) { ... }
fn encrypt_block_b2b_mut(
&mut self,
in_block: &Block<Self>,
out_block: &mut Block<Self>,
) { ... }
fn encrypt_blocks_mut(&mut self, blocks: &mut [Block<Self>]) { ... }
fn encrypt_blocks_b2b_mut(
&mut self,
in_blocks: &[Block<Self>],
out_blocks: &mut [Block<Self>],
) -> Result<(), NotEqualError> { ... }
}
Expand description
Encrypt-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 encrypt_with_backend_mut(
&mut self,
f: impl BlockClosure<BlockSize = Self::BlockSize>,
)
fn encrypt_with_backend_mut( &mut self, f: impl BlockClosure<BlockSize = Self::BlockSize>, )
Encrypt data using backend provided to the rank-2 closure.
Provided Methods§
Sourcefn encrypt_block_inout_mut(&mut self, block: InOut<'_, '_, Block<Self>>)
fn encrypt_block_inout_mut(&mut self, block: InOut<'_, '_, Block<Self>>)
Encrypt single inout
block.
Sourcefn encrypt_blocks_inout_mut(&mut self, blocks: InOutBuf<'_, '_, Block<Self>>)
fn encrypt_blocks_inout_mut(&mut self, blocks: InOutBuf<'_, '_, Block<Self>>)
Encrypt inout
blocks.
Sourcefn encrypt_block_mut(&mut self, block: &mut Block<Self>)
fn encrypt_block_mut(&mut self, block: &mut Block<Self>)
Encrypt single block in-place.
Sourcefn encrypt_block_b2b_mut(
&mut self,
in_block: &Block<Self>,
out_block: &mut Block<Self>,
)
fn encrypt_block_b2b_mut( &mut self, in_block: &Block<Self>, out_block: &mut Block<Self>, )
Encrypt in_block
and write result to out_block
.
Sourcefn encrypt_blocks_mut(&mut self, blocks: &mut [Block<Self>])
fn encrypt_blocks_mut(&mut self, blocks: &mut [Block<Self>])
Encrypt blocks in-place.
Sourcefn encrypt_blocks_b2b_mut(
&mut self,
in_blocks: &[Block<Self>],
out_blocks: &mut [Block<Self>],
) -> Result<(), NotEqualError>
fn encrypt_blocks_b2b_mut( &mut self, in_blocks: &[Block<Self>], out_blocks: &mut [Block<Self>], ) -> Result<(), NotEqualError>
Encrypt blocks buffer-to-buffer.
Returns NotEqualError
if provided in_blocks
and out_blocks
have different lengths.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.