pub trait OpeningCipher: CipherCore {
// Required methods
fn decrypt<B: AsMut<[u8]>>(&mut self, buf: B) -> Result<(), Self::Err>;
fn open<B: AsRef<[u8]>>(
&mut self,
buf: B,
mac: Vec<u8>,
seq: u32,
) -> Result<(), Self::Err>;
fn decompress(&mut self, buf: Vec<u8>) -> Result<Vec<u8>, Self::Err>;
}
Expand description
A cipher able to open
a Packet
and retrieve it’s payload.
Required Methods§
Sourcefn decrypt<B: AsMut<[u8]>>(&mut self, buf: B) -> Result<(), Self::Err>
fn decrypt<B: AsMut<[u8]>>(&mut self, buf: B) -> Result<(), Self::Err>
Decrypt the received buf
using the OpeningCipher
.
Sourcefn open<B: AsRef<[u8]>>(
&mut self,
buf: B,
mac: Vec<u8>,
seq: u32,
) -> Result<(), Self::Err>
fn open<B: AsRef<[u8]>>( &mut self, buf: B, mac: Vec<u8>, seq: u32, ) -> Result<(), Self::Err>
Compare the received buf
against the received Message Authentication Code.
Sourcefn decompress(&mut self, buf: Vec<u8>) -> Result<Vec<u8>, Self::Err>
fn decompress(&mut self, buf: Vec<u8>) -> Result<Vec<u8>, Self::Err>
Decompress the received buf
using the OpeningCipher
.
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.