[−][src]Struct miscreant::stream::Decryptor
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
Implementations
impl<A: Aead> Decryptor<A>
[src]
pub 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.
pub fn decrypt_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
pub fn decrypt_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
pub fn decrypt_next(
&mut self,
ad: &[u8],
ciphertext: &[u8]
) -> Result<Vec<u8>, Error>
[src]
&mut self,
ad: &[u8],
ciphertext: &[u8]
) -> Result<Vec<u8>, Error>
Decrypt the next message in the stream, allocating and returning a
Vec<u8>
for the plaintext
pub fn decrypt_last(
self,
ad: &[u8],
ciphertext: &[u8]
) -> Result<Vec<u8>, Error>
[src]
self,
ad: &[u8],
ciphertext: &[u8]
) -> Result<Vec<u8>, Error>
Decrypt the next message in the stream, allocating and returning a
Vec<u8>
for the plaintext
Auto Trait Implementations
impl<A> RefUnwindSafe for Decryptor<A> where
A: RefUnwindSafe,
A: RefUnwindSafe,
impl<A> Send for Decryptor<A> where
A: Send,
A: Send,
impl<A> Sync for Decryptor<A> where
A: Sync,
A: Sync,
impl<A> Unpin for Decryptor<A> where
A: Unpin,
A: Unpin,
impl<A> UnwindSafe for Decryptor<A> where
A: UnwindSafe,
A: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,