pub trait Encapsulate<EK, SS> {
type Error: Debug;
// Required method
fn encapsulate(
&self,
rng: &mut impl CryptoRngCore,
) -> Result<(EK, SS), Self::Error>;
}
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§
Required Methods§
Sourcefn encapsulate(
&self,
rng: &mut impl CryptoRngCore,
) -> Result<(EK, SS), Self::Error>
fn encapsulate( &self, rng: &mut impl CryptoRngCore, ) -> Result<(EK, SS), Self::Error>
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.