pub trait StreamCipher {
type Key: AsRef<[u8]>;
type Nonce: AsRef<[u8]>;
// Required methods
fn new(key: &Self::Key, iv: &Self::Nonce) -> Self;
fn apply_keystream(&mut self, buffer: &mut [u8]) -> Result<(), CipherError>;
}Expand description
Synchronous stream cipher trait.
Required Associated Types§
Required Methods§
Sourcefn new(key: &Self::Key, iv: &Self::Nonce) -> Self
fn new(key: &Self::Key, iv: &Self::Nonce) -> Self
Instantiate a new instance of a stream cipher from a key and iv.
Sourcefn apply_keystream(&mut self, buffer: &mut [u8]) -> Result<(), CipherError>
fn apply_keystream(&mut self, buffer: &mut [u8]) -> Result<(), CipherError>
Applies the cipher keystream to buffer in place, returning CipherError on an unsuccessful
operation.
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.