Skip to main content

KeyDecapsulationKey

Trait KeyDecapsulationKey 

Source
pub trait KeyDecapsulationKey: Send + Sync {
    // Required methods
    fn algorithm(&self) -> KeyEncapsulationAlgorithm;
    fn decapsulate(
        &self,
        ciphertext: &[u8],
    ) -> Result<Zeroizing<[u8; 32]>, ProviderError>;

    // Provided method
    fn provider_binding(&self) -> Option<&ProviderBinding> { ... }
}
Expand description

Opaque recipient private key. Valid-size ciphertext rejection stays implicit.

Required Methods§

Source

fn algorithm(&self) -> KeyEncapsulationAlgorithm

Parameter set of this actual key.

Source

fn decapsulate( &self, ciphertext: &[u8], ) -> Result<Zeroizing<[u8; 32]>, ProviderError>

FIPS 203 section 7.3: return the real-or-rejection secret without validity metadata.

Provided Methods§

Source

fn provider_binding(&self) -> Option<&ProviderBinding>

Engine ownership, when an external engine owns this handle.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§