pub struct MockEncapsulator;Expand description
In-memory test encapsulator for “mock” algorithm.
NOT FOR PRODUCTION USE. Generates a random 32-byte shared secret and stores it in the EncapsulatedKey for the decapsulator to recover. Used for testing the session lifecycle without a real crypto backend.
Trait Implementations§
Source§impl Encapsulator for MockEncapsulator
impl Encapsulator for MockEncapsulator
Source§fn encapsulate(
&self,
_recipient_public_key: &ThresholdPublicKey,
) -> Result<(EncapsulatedKey, SharedSecret), EncapsulateError>
fn encapsulate( &self, _recipient_public_key: &ThresholdPublicKey, ) -> Result<(EncapsulatedKey, SharedSecret), EncapsulateError>
Encapsulate a fresh shared secret to
recipient_public_key.
Returns (encapsulated_key, shared_secret) — the encryptor keeps
the shared secret for AEAD encryption, the encapsulated key
travels with the ciphertext.Auto Trait Implementations§
impl Freeze for MockEncapsulator
impl RefUnwindSafe for MockEncapsulator
impl Send for MockEncapsulator
impl Sync for MockEncapsulator
impl Unpin for MockEncapsulator
impl UnsafeUnpin for MockEncapsulator
impl UnwindSafe for MockEncapsulator
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