Skip to main content

CryptoStream

Trait CryptoStream 

Source
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§

Source

fn apply_keystream_byte(&mut self, b: u8) -> u8

Applies the keystream byte to the given byte and returns the result.

Source

fn apply_keystream(&mut self, slice: &[u8]) -> &[u8]

Applies the keystream to the given slice and returns the result.

Source

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.

Source

fn replace(&mut self, other: Box<dyn CryptoStream>)

Extend the internal state of this crypto stream with another’s.

Implementors§