pub struct EncapCtx { /* private fields */ }Expand description
KEM encapsulation context (recipient’s public key).
Implementations§
Source§impl EncapCtx
impl EncapCtx
Sourcepub fn new(key: &Pkey<Public>) -> Result<Self, ErrorStack>
pub fn new(key: &Pkey<Public>) -> Result<Self, ErrorStack>
Create a KEM encapsulation context from the recipient’s public key.
§Errors
Sourcepub fn encapsulate(&mut self) -> Result<EncapResult, ErrorStack>
pub fn encapsulate(&mut self) -> Result<EncapResult, ErrorStack>
Perform encapsulation, returning the wrapped key and shared secret.
§Errors
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EncapCtx
impl RefUnwindSafe for EncapCtx
impl !Send for EncapCtx
impl !Sync for EncapCtx
impl Unpin for EncapCtx
impl UnwindSafe for EncapCtx
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