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