pub struct SendCtx<K, F, A>{ /* private fields */ }Expand description
An encryption context that encrypts messages for a particular recipient.
Implementations§
Source§impl<K, F, A> SendCtx<K, F, A>
impl<K, F, A> SendCtx<K, F, A>
Sourcepub const OVERHEAD: usize = SealCtx<A>::OVERHEAD
pub const OVERHEAD: usize = SealCtx<A>::OVERHEAD
The size in bytes of the overhead added to the plaintext.
Sourcepub fn seal(
&mut self,
dst: &mut [u8],
plaintext: &[u8],
additional_data: &[u8],
) -> Result<Seq, HpkeError>
pub fn seal( &mut self, dst: &mut [u8], plaintext: &[u8], additional_data: &[u8], ) -> Result<Seq, HpkeError>
Encrypts and authenticates plaintext, returning the
sequence number.
The resulting ciphertext is written to dst, which must
be at least plaintext.len() + OVERHEAD
bytes long.
Sourcepub fn seal_in_place(
&mut self,
data: impl AsMut<[u8]>,
tag: &mut [u8],
additional_data: &[u8],
) -> Result<Seq, HpkeError>
pub fn seal_in_place( &mut self, data: impl AsMut<[u8]>, tag: &mut [u8], additional_data: &[u8], ) -> Result<Seq, HpkeError>
Encrypts and authenticates data in-place, returning the
sequence number.
Trait Implementations§
Auto Trait Implementations§
impl<K, F, A> Freeze for SendCtx<K, F, A>
impl<K, F, A> RefUnwindSafe for SendCtx<K, F, A>where
A: RefUnwindSafe,
<<A as Aead>::NonceSize as ArrayLength>::ArrayType<u8>: RefUnwindSafe,
<<A as Aead>::KeySize as ArrayLength>::ArrayType<u8>: RefUnwindSafe,
<<F as Kdf>::PrkSize as ArrayLength>::ArrayType<u8>: RefUnwindSafe,
impl<K, F, A> Send for SendCtx<K, F, A>where
A: Send,
impl<K, F, A> Sync for SendCtx<K, F, A>where
A: Sync,
impl<K, F, A> Unpin for SendCtx<K, F, A>
impl<K, F, A> UnwindSafe for SendCtx<K, F, A>where
A: UnwindSafe,
<<A as Aead>::NonceSize as ArrayLength>::ArrayType<u8>: UnwindSafe,
<<A as Aead>::KeySize as ArrayLength>::ArrayType<u8>: UnwindSafe,
<<F as Kdf>::PrkSize as ArrayLength>::ArrayType<u8>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more