pub trait KemCore {
type SharedKeySize: ArraySize;
type CiphertextSize: ArraySize;
type DecapsulationKey: Decapsulate<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Debug + PartialEq;
type EncapsulationKey: Encapsulate<Ciphertext<Self>, SharedKey<Self>> + EncapsulateDeterministic<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Debug + PartialEq;
// Required methods
fn generate(
rng: &mut impl CryptoRngCore,
) -> (Self::DecapsulationKey, Self::EncapsulationKey);
fn generate_deterministic(
d: &B32,
z: &B32,
) -> (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>> + EncapsulateDeterministic<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Debug + PartialEq
Available on crate feature deterministic
only.
type EncapsulationKey: Encapsulate<Ciphertext<Self>, SharedKey<Self>> + EncapsulateDeterministic<Ciphertext<Self>, SharedKey<Self>> + EncodedSizeUser + Debug + PartialEq
deterministic
only.An encapsulation key for this KEM
Required Methods§
sourcefn generate(
rng: &mut impl CryptoRngCore,
) -> (Self::DecapsulationKey, Self::EncapsulationKey)
fn generate( rng: &mut impl CryptoRngCore, ) -> (Self::DecapsulationKey, Self::EncapsulationKey)
Generate a new (decapsulation, encapsulation) key pair
sourcefn generate_deterministic(
d: &B32,
z: &B32,
) -> (Self::DecapsulationKey, Self::EncapsulationKey)
Available on crate feature deterministic
only.
fn generate_deterministic( d: &B32, z: &B32, ) -> (Self::DecapsulationKey, Self::EncapsulationKey)
deterministic
only.Generate a new (decapsulation, encapsulation) key pair deterministically
Object Safety§
This trait is not object safe.