Encapsulate

Trait Encapsulate 

Source
pub trait Encapsulate<EK, SS> {
    type Error: Debug;

    // Required method
    fn encapsulate<R>(&self, rng: &mut R) -> Result<(EK, SS), Self::Error>
       where R: TryCryptoRng + ?Sized;
}
Expand description

A value that can be encapsulated to. Often, this will just be a public key. However, it can also be a bundle of public keys, or it can include a sender’s private key for authenticated encapsulation.

Required Associated Types§

Source

type Error: Debug

Encapsulation error

Required Methods§

Source

fn encapsulate<R>(&self, rng: &mut R) -> Result<(EK, SS), Self::Error>
where R: TryCryptoRng + ?Sized,

Encapsulates a fresh shared secret

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<P> Encapsulate<Array<u8, <P as PkeParams>::CiphertextSize>, Array<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for EncapsulationKey<P>
where P: KemParams,

Source§

type Error = Infallible

Source§

fn encapsulate<R>( &self, rng: &mut R, ) -> Result<(Array<u8, <P as PkeParams>::CiphertextSize>, Array<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>), <EncapsulationKey<P> as Encapsulate<Array<u8, <P as PkeParams>::CiphertextSize>, Array<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>>>::Error>
where R: TryCryptoRng + ?Sized,

Implementors§