pub trait KemCore: Clone {
type SharedKeySize: ArraySize;
type CiphertextSize: ArraySize;
type DecapsulationKey: Decapsulate<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Debug + PartialEq;
type EncapsulationKey: Encapsulate<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Clone + Debug + PartialEq;
// Required methods
fn generate<R: CryptoRng + ?Sized>(
rng: &mut R,
) -> (Self::DecapsulationKey, Self::EncapsulationKey);
fn from_seed(seed: Seed) -> (Self::DecapsulationKey, Self::EncapsulationKey);
}Expand description
A generic interface to a Key Encapsulation Method
Required Associated Types§
The size of a shared key generated by this KEM
Sourcetype CiphertextSize: ArraySize
type CiphertextSize: ArraySize
The size of a ciphertext encapsulating a shared key
Sourcetype DecapsulationKey: Decapsulate<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Debug + PartialEq
type DecapsulationKey: Decapsulate<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Debug + PartialEq
A decapsulation key for this KEM
Sourcetype EncapsulationKey: Encapsulate<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Clone + Debug + PartialEq
type EncapsulationKey: Encapsulate<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Clone + Debug + PartialEq
An encapsulation key for this KEM
Required Methods§
Sourcefn generate<R: CryptoRng + ?Sized>(
rng: &mut R,
) -> (Self::DecapsulationKey, Self::EncapsulationKey)
fn generate<R: CryptoRng + ?Sized>( rng: &mut R, ) -> (Self::DecapsulationKey, Self::EncapsulationKey)
Generate a new (decapsulation, encapsulation) key pair.
Sourcefn from_seed(seed: Seed) -> (Self::DecapsulationKey, Self::EncapsulationKey)
fn from_seed(seed: Seed) -> (Self::DecapsulationKey, Self::EncapsulationKey)
Generate a new (decapsulation, encapsulation) key pair deterministically from the given uniformly random seed value.
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.