pub trait CryptoStream {
// Required methods
fn apply_keystream_byte(&mut self, b: u8) -> u8;
fn apply_keystream(&mut self, slice: &[u8]) -> &[u8] ⓘ;
fn get_cached(&self, original: bool) -> &[u8] ⓘ;
fn replace(&mut self, other: Box<dyn CryptoStream>);
}Expand description
Crypto Stream
Required Methods§
Sourcefn apply_keystream_byte(&mut self, b: u8) -> u8
fn apply_keystream_byte(&mut self, b: u8) -> u8
Applies the keystream byte to the given byte and returns the result.
Sourcefn apply_keystream(&mut self, slice: &[u8]) -> &[u8] ⓘ
fn apply_keystream(&mut self, slice: &[u8]) -> &[u8] ⓘ
Applies the keystream to the given slice and returns the result.
Sourcefn get_cached(&self, original: bool) -> &[u8] ⓘ
fn get_cached(&self, original: bool) -> &[u8] ⓘ
Get the underlying original/encrypted buffer
original indicates whether to return the original (unencrypted) buffer or the encrypted buffer.
Sourcefn replace(&mut self, other: Box<dyn CryptoStream>)
fn replace(&mut self, other: Box<dyn CryptoStream>)
Extend the internal state of this crypto stream with another’s.