[−][src]Function hpke::single_shot_open
pub fn single_shot_open<A, Kdf, Kem>(
mode: &OpModeR<Kem::Kex>,
sk_recip: &<Kem::Kex as KeyExchange>::PrivateKey,
encapped_key: &EncappedKey<Kem::Kex>,
info: &[u8],
ciphertext: &mut [u8],
aad: &[u8],
tag: &AeadTag<A>
) -> Result<(), HpkeError> where
A: Aead,
Kdf: KdfTrait,
Kem: KemTrait,
Does a setup_receiver
and AeadCtx::open
in one shot. That is, it does a key decapsulation
for the specified recipient and decrypts the provided plaintext in place. See
setup::setup_reciever
and AeadCtx::open
for more detail.
Return Value
Returns Ok()
on success. If an error happened during key exchange, returns
Err(HpkeError::InvalidKeyExchange)
. If an unspecified error happened during decryption,
returns Err(HpkeError::Encryption)
. In this case, the contents of ciphertext
is undefined.