Function hpke::setup_receiver

source ·
pub fn setup_receiver<A, Kdf, Kem>(
    mode: &OpModeR<'_, Kem>,
    sk_recip: &Kem::PrivateKey,
    encapped_key: &Kem::EncappedKey,
    info: &[u8]
) -> Result<AeadCtxR<A, Kdf, Kem>, HpkeError>where
    A: Aead,
    Kdf: KdfTrait,
    Kem: KemTrait,
Expand description

Initiates a decryption context given a private key sk_recip and an encapsulated key which was encapsulated to sk_recip’s corresponding public key

Return Value

On success, returns a decryption context. If an error happened during key decapsulation, returns Err(HpkeError::DecapError). This is the only possible error.