Struct aead::stream::Encryptor [−][src]
stream
only.Stateful STREAM object which can encrypt AEAD messages one-at-a-time.
This corresponds to the ℰ STREAM encryptor object as defined in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance.
Implementations
impl<A, S> Encryptor<A, S> where
A: AeadInPlace,
S: StreamPrimitive<A>,
A::NonceSize: Sub<<S as StreamPrimitive<A>>::NonceOverhead>,
NonceSize<A, S>: ArrayLength<u8>,
[src]
A: AeadInPlace,
S: StreamPrimitive<A>,
A::NonceSize: Sub<<S as StreamPrimitive<A>>::NonceOverhead>,
NonceSize<A, S>: ArrayLength<u8>,
pub fn new(key: &Key<A>, nonce: &Nonce<A, S>) -> Self where
A: NewAead,
S: NewStream<A>,
[src]
A: NewAead,
S: NewStream<A>,
Create a ℰ STREAM encryptor object from the given AEAD key and nonce.
pub fn from_aead(aead: A, nonce: &Nonce<A, S>) -> Self where
A: NewAead,
S: NewStream<A>,
[src]
A: NewAead,
S: NewStream<A>,
Create a ℰ STREAM encryptor object from the given AEAD primitive.
pub fn from_stream_primitive(stream: S) -> Self
[src]
Create a ℰ STREAM encryptor object from the given STREAM primitive.
pub fn encrypt_next<'msg, 'aad>(
&mut self,
payload: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&mut self,
payload: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
alloc
only.Use the underlying AEAD to
encrypt
the next AEAD message in this STREAM, returning the
result as a Vec
.
pub fn encrypt_next_in_place(
&mut self,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&mut self,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
Use the underlying AEAD to encrypt the next AEAD message in this STREAM in-place.
pub fn encrypt_last<'msg, 'aad>(
self,
payload: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
self,
payload: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
alloc
only.Use the underlying AEAD to encrypt the last AEAD message in this STREAM, consuming the ℰ STREAM encryptor object in order to prevent further use.
pub fn encrypt_last_in_place(
self,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
self,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
Use the underlying AEAD to encrypt the last AEAD message in this STREAM in-place, consuming the ℰ STREAM encryptor object in order to prevent further use.
Auto Trait Implementations
impl<A, S> RefUnwindSafe for Encryptor<A, S> where
S: RefUnwindSafe,
<S as StreamPrimitive<A>>::Counter: RefUnwindSafe,
[src]
S: RefUnwindSafe,
<S as StreamPrimitive<A>>::Counter: RefUnwindSafe,
impl<A, S> Send for Encryptor<A, S> where
S: Send,
<S as StreamPrimitive<A>>::Counter: Send,
[src]
S: Send,
<S as StreamPrimitive<A>>::Counter: Send,
impl<A, S> Sync for Encryptor<A, S> where
S: Sync,
<S as StreamPrimitive<A>>::Counter: Sync,
[src]
S: Sync,
<S as StreamPrimitive<A>>::Counter: Sync,
impl<A, S> Unpin for Encryptor<A, S> where
S: Unpin,
<S as StreamPrimitive<A>>::Counter: Unpin,
[src]
S: Unpin,
<S as StreamPrimitive<A>>::Counter: Unpin,
impl<A, S> UnwindSafe for Encryptor<A, S> where
S: UnwindSafe,
<S as StreamPrimitive<A>>::Counter: UnwindSafe,
[src]
S: UnwindSafe,
<S as StreamPrimitive<A>>::Counter: 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,
pub 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.
pub 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>,