struct DhKem<const KDF_SIZE: usize> {
id: HpkeKem,
agreement_algorithm: &'static Algorithm,
key_generator: &'static (dyn Fn() -> Result<(HpkePublicKey, HpkePrivateKey), Error> + Send + Sync),
hkdf: &'static dyn HkdfPrkExtract,
}
Expand description
A Diffie-Hellman (DH) based Key Encapsulation Mechanism (KEM).
Fields§
§id: HpkeKem
§agreement_algorithm: &'static Algorithm
§key_generator: &'static (dyn Fn() -> Result<(HpkePublicKey, HpkePrivateKey), Error> + Send + Sync)
§hkdf: &'static dyn HkdfPrkExtract
Implementations§
Source§impl<const KDF_SIZE: usize> DhKem<KDF_SIZE>
impl<const KDF_SIZE: usize> DhKem<KDF_SIZE>
Sourcefn encap(
&self,
recipient: &HpkePublicKey,
) -> Result<(KemSharedSecret<KDF_SIZE>, EncapsulatedSecret), Error>
fn encap( &self, recipient: &HpkePublicKey, ) -> Result<(KemSharedSecret<KDF_SIZE>, EncapsulatedSecret), Error>
fn encap_impl( &self, recipient: &HpkePublicKey, sk_e: PrivateKey, ) -> Result<(KemSharedSecret<KDF_SIZE>, EncapsulatedSecret), Error>
Sourcefn decap(
&self,
enc: &EncapsulatedSecret,
recipient: &HpkePrivateKey,
) -> Result<KemSharedSecret<KDF_SIZE>, Error>
fn decap( &self, enc: &EncapsulatedSecret, recipient: &HpkePrivateKey, ) -> Result<KemSharedSecret<KDF_SIZE>, Error>
Auto Trait Implementations§
impl<const KDF_SIZE: usize> Freeze for DhKem<KDF_SIZE>
impl<const KDF_SIZE: usize> !RefUnwindSafe for DhKem<KDF_SIZE>
impl<const KDF_SIZE: usize> Send for DhKem<KDF_SIZE>
impl<const KDF_SIZE: usize> Sync for DhKem<KDF_SIZE>
impl<const KDF_SIZE: usize> Unpin for DhKem<KDF_SIZE>
impl<const KDF_SIZE: usize> !UnwindSafe for DhKem<KDF_SIZE>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more