pub trait Encapsulate: TryKeyInit + KeyExport {
type Kem: Kem;
// Required method
fn encapsulate_with_rng<R>(
&self,
rng: &mut R,
) -> (Array<u8, <Self::Kem as Kem>::CiphertextSize>, Array<u8, <Self::Kem as Kem>::SharedKeySize>)
where R: CryptoRng + ?Sized;
// Provided method
fn encapsulate(
&self,
) -> (Array<u8, <Self::Kem as Kem>::CiphertextSize>, Array<u8, <Self::Kem as Kem>::SharedKeySize>) { ... }
}Expand description
Encapsulator for shared secrets.
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§
Required Methods§
Provided Methods§
Sourcefn encapsulate(
&self,
) -> (Array<u8, <Self::Kem as Kem>::CiphertextSize>, Array<u8, <Self::Kem as Kem>::SharedKeySize>)
fn encapsulate( &self, ) -> (Array<u8, <Self::Kem as Kem>::CiphertextSize>, Array<u8, <Self::Kem as Kem>::SharedKeySize>)
Encapsulate a fresh shared secret generated using the system’s secure RNG.
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.