[−][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>, HpkeError> where
A: Aead,
Kdf: KdfTrait,
Kem: KemTrait,
Initiates an encryption context given a private key sk
and an encapsulated key which was
encapsulated to sk
's corresponding public key
Return Value
On success, returns an encryption context. If an error happened during key exchange, returns
Err(HpkeError::InvalidKeyExchange)
. This is the only possible error.