Function hpke::single_shot_open_in_place_detached
source · pub fn single_shot_open_in_place_detached<A, Kdf, Kem>(
mode: &OpModeR<'_, Kem>,
sk_recip: &Kem::PrivateKey,
encapped_key: &Kem::EncappedKey,
info: &[u8],
ciphertext: &mut [u8],
aad: &[u8],
tag: &AeadTag<A>
) -> Result<(), HpkeError>where
A: Aead,
Kdf: KdfTrait,
Kem: KemTrait,
Expand description
Does a setup_receiver
and AeadCtxR::open_in_place_detached
in one shot. That is, it does a
key decapsulation for the specified recipient and decrypts the provided ciphertext in place.
See setup::setup_reciever
and AeadCtxR::open_in_place_detached
for more detail.
Return Value
Returns Ok()
on success. If an error happened during key decapsulation, returns
Err(HpkeError::DecapError)
. If an error happened during decryption, returns
Err(HpkeError::OpenError)
. In this case, the contents of ciphertext
is undefined.