Struct miscreant::stream::Encryptor
[−]
[src]
pub struct Encryptor<A: Algorithm> { /* fields omitted */ }
A STREAM encryptor with a 32-bit counter, generalized for any AEAD algorithm
This corresponds to the ℰ stream encryptor object as defined in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance
Methods
impl<A: Algorithm> Encryptor<A>
[src]
fn new(key: &[u8], nonce: &[u8]) -> Self
[src]
Create a new STREAM encryptor, initialized with a given key and nonce.
Panics if the key or nonce is the wrong size.
fn seal_next_in_place(&mut self, ad: &[u8], buffer: &mut [u8])
[src]
Encrypt the next message in the stream in-place
fn seal_last_in_place(self, ad: &[u8], buffer: &mut [u8])
[src]
Encrypt the final message in-place, consuming the stream encryptor
fn seal_next(&mut self, ad: &[u8], plaintext: &[u8]) -> Vec<u8>
[src]
Encrypt the next message in the stream, allocating and returning a
Vec<u8>
for the ciphertext
fn seal_last(self, ad: &[u8], plaintext: &[u8]) -> Vec<u8>
[src]
Encrypt the final message in the stream, allocating and returning a
Vec<u8>
for the ciphertext