[−][src]Struct hpke::AeadCtxR
The HPKE receiver's context. This is what you use to open
ciphertexts.
Implementations
impl<A: Aead, K: Kdf> AeadCtxR<A, K>
[src]
pub fn open(
&mut self,
ciphertext: &mut [u8],
aad: &[u8],
tag: &AeadTag<A>
) -> Result<(), HpkeError>
[src]
&mut self,
ciphertext: &mut [u8],
aad: &[u8],
tag: &AeadTag<A>
) -> Result<(), HpkeError>
Does a "detached open in place", meaning it overwrites ciphertext
with the resulting
plaintext, and takes the tag as a separate input.
Return Value
Returns Ok(())
on success. If this context has been used for so many encryptions that
the sequence number overflowed, returns Err(HpkeError::SeqOverflow)
. If this happens,
plaintext
will be unmodified. If the tag fails to validate, returns
Err(HpkeError::InvalidTag)
. If this happens, plaintext
is in an undefined state.
pub fn export(&self, info: &[u8], out_buf: &mut [u8]) -> Result<(), HpkeError>
[src]
Fills a given buffer with secret bytes derived from this encryption context. This value does not depend on sequence number, so it is constant for the lifetime of this context.
Return Value
Returns Ok(())
on success. If the buffer length is more than 255x the digest size of the
underlying hash function, returns an Err(HpkeError::InvalidKdfLength)
.
Auto Trait Implementations
impl<A, K> Send for AeadCtxR<A, K> where
<A as Aead>::AeadImpl: Aead + Send,
<K as Kdf>::HashImpl: Digest,
<<A as Aead>::AeadImpl as Aead>::NonceSize: ArrayLength<u8>,
<<K as Kdf>::HashImpl as Digest>::OutputSize: ArrayLength<u8>,
<A as Aead>::AeadImpl: Aead + Send,
<K as Kdf>::HashImpl: Digest,
<<A as Aead>::AeadImpl as Aead>::NonceSize: ArrayLength<u8>,
<<K as Kdf>::HashImpl as Digest>::OutputSize: ArrayLength<u8>,
impl<A, K> Sync for AeadCtxR<A, K> where
<A as Aead>::AeadImpl: Aead + Sync,
<K as Kdf>::HashImpl: Digest,
<<A as Aead>::AeadImpl as Aead>::NonceSize: ArrayLength<u8>,
<<K as Kdf>::HashImpl as Digest>::OutputSize: ArrayLength<u8>,
<A as Aead>::AeadImpl: Aead + Sync,
<K as Kdf>::HashImpl: Digest,
<<A as Aead>::AeadImpl as Aead>::NonceSize: ArrayLength<u8>,
<<K as Kdf>::HashImpl as Digest>::OutputSize: ArrayLength<u8>,
impl<A, K> Unpin for AeadCtxR<A, K> where
<A as Aead>::AeadImpl: Aead + Unpin,
<<<A as Aead>::AeadImpl as Aead>::NonceSize as ArrayLength<u8>>::ArrayType: Unpin,
<<<K as Kdf>::HashImpl as Digest>::OutputSize as ArrayLength<u8>>::ArrayType: Unpin,
<K as Kdf>::HashImpl: Digest,
<A as Aead>::AeadImpl: Aead + Unpin,
<<<A as Aead>::AeadImpl as Aead>::NonceSize as ArrayLength<u8>>::ArrayType: Unpin,
<<<K as Kdf>::HashImpl as Digest>::OutputSize as ArrayLength<u8>>::ArrayType: Unpin,
<K as Kdf>::HashImpl: Digest,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,