[][src]Function hpke::setup_receiver

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

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 exchange, returns Err(HpkeError::InvalidKeyExchange). This is the only possible error.