pub struct Sealer<A: Aead> { /* private fields */ }Expand description
Seals messages under nonces it builds itself, each used once.
Implementations§
Source§impl<A: Aead> Sealer<A>
impl<A: Aead> Sealer<A>
Sourcepub fn new(key: &[u8], fixed: [u8; 4]) -> Result<Self>
pub fn new(key: &[u8], fixed: [u8; 4]) -> Result<Self>
A sealer whose first nonce is fixed || 0.
fixed names this sender. Any other party sealing under key must use
a different one.
Sourcepub fn resume(key: &[u8], fixed: [u8; 4], counter: u64) -> Result<Self>
pub fn resume(key: &[u8], fixed: [u8; 4], counter: u64) -> Result<Self>
A sealer that continues from counter, the value a previous sealer on
this key and fixed field reported from Sealer::counter when it was
last used.
Restoring a counter lower than one already used reuses nonces. Persist the counter before sending what it sealed, not after.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Sealer<A>where
A: Freeze,
impl<A> RefUnwindSafe for Sealer<A>where
A: RefUnwindSafe,
impl<A> Send for Sealer<A>where
A: Send,
impl<A> Sync for Sealer<A>where
A: Sync,
impl<A> Unpin for Sealer<A>where
A: Unpin,
impl<A> UnsafeUnpin for Sealer<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for Sealer<A>where
A: 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