pub trait SealingCipher: CipherCore {
// Required methods
fn compress<B: AsRef<[u8]>>(&mut self, buf: B) -> Result<Vec<u8>, Self::Err>;
fn pad(&mut self, buf: Vec<u8>, padding: u8) -> Result<Vec<u8>, Self::Err>;
fn encrypt<B: AsMut<[u8]>>(&mut self, buf: B) -> Result<(), Self::Err>;
fn seal<B: AsRef<[u8]>>(
&mut self,
buf: B,
seq: u32,
) -> Result<Vec<u8>, Self::Err>;
}
Expand description
A cipher able to seal
a payload to create a Packet
.
Required Methods§
Sourcefn compress<B: AsRef<[u8]>>(&mut self, buf: B) -> Result<Vec<u8>, Self::Err>
fn compress<B: AsRef<[u8]>>(&mut self, buf: B) -> Result<Vec<u8>, Self::Err>
Decompress the buf
using the SealingCipher
.
Sourcefn pad(&mut self, buf: Vec<u8>, padding: u8) -> Result<Vec<u8>, Self::Err>
fn pad(&mut self, buf: Vec<u8>, padding: u8) -> Result<Vec<u8>, Self::Err>
Pad the buf
to match SealingCipher
’s block size with random data,
by increasing it by padding
bytes and prefixing the buf
it with it’s len.
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.