pub trait StreamingCipher: SecKeyGen {
// Required methods
fn info(&self) -> CipherInfo;
fn init(
&mut self,
key: &[u8],
nonce: &[u8],
) -> Result<(), Box<dyn Error + 'static>>;
fn update(
&mut self,
input: &[u8],
output: impl Write,
) -> Result<usize, Box<dyn Error + 'static>>;
fn finish(
&mut self,
output: impl Write,
) -> Result<usize, Box<dyn Error + 'static>>;
}
Expand description
A stateful (streaming) cipher interface
Required Methods§
Sourcefn info(&self) -> CipherInfo
fn info(&self) -> CipherInfo
Returns information about the cipher
Sourcefn init(
&mut self,
key: &[u8],
nonce: &[u8],
) -> Result<(), Box<dyn Error + 'static>>
fn init( &mut self, key: &[u8], nonce: &[u8], ) -> Result<(), Box<dyn Error + 'static>>
(Re-)initializes the handle with key
and nonce
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.