pub trait UnalignedBytesDecryptMut: BlockDecryptMut + BlockSizeUser {
// Required method
fn proc_tail(
&self,
blocks: &mut InOutBuf<'_, '_, Block<Self>>,
tail: &mut InOutBuf<'_, '_, u8>,
) -> Result<(), TailError>;
// Provided methods
fn decrypt_bytes_inout_mut<'inp, 'out>(
&mut self,
data: InOutBuf<'inp, 'out, u8>,
) -> Result<&'out [u8], TailError> { ... }
fn decrypt_bytes_mut<'a>(
&mut self,
buf: &'a mut [u8],
) -> Result<&'a [u8], TailError> { ... }
fn decrypt_bytes_b2b_mut<'a>(
&mut self,
msg: &[u8],
out_buf: &'a mut [u8],
) -> Result<&'a [u8], TailError> { ... }
}
Expand description
In many cases, plaintext and ciphertext input is not divisible by the block size, and padding is often used.
In practical use, however, this is not always done, and user-specified processing to an unaligned part like, for example, XOR, is often applied.
This trait enables to apply additional processing to an unaligned [tail
].
Required Methods§
Sourcefn proc_tail(
&self,
blocks: &mut InOutBuf<'_, '_, Block<Self>>,
tail: &mut InOutBuf<'_, '_, u8>,
) -> Result<(), TailError>
fn proc_tail( &self, blocks: &mut InOutBuf<'_, '_, Block<Self>>, tail: &mut InOutBuf<'_, '_, u8>, ) -> Result<(), TailError>
In many cases, plaintext and ciphertext input is not divisible by the block size, and padding is often used.
In practical use, however, this is not always done, and the termination may be handled by, for example, XOR.
This trait and fn [proc_tail
] divides the input into aligned blocks and an unaligned part([tail
]),
and then applies appropriate user-specified processing to the [tail
].
Provided Methods§
Sourcefn decrypt_bytes_inout_mut<'inp, 'out>(
&mut self,
data: InOutBuf<'inp, 'out, u8>,
) -> Result<&'out [u8], TailError>
fn decrypt_bytes_inout_mut<'inp, 'out>( &mut self, data: InOutBuf<'inp, 'out, u8>, ) -> Result<&'out [u8], TailError>
Decrypt inout
bytes slice.
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.