Function hpke_dispatch::base_mode_open
source · pub fn base_mode_open(
config: &Config,
private_key: &[u8],
encapped_key: &[u8],
info: &[u8],
ciphertext: &[u8],
aad: &[u8]
) -> Result<Vec<u8>, HpkeError>
Expand description
base_mode_open
provides an interface to hpke::single_shot_open
that does not require compile time selection of an algorithm. Instead,
the selected algorithm is provided through the Config
passed as
the first argument.
Requires the base-mode-open
crate feature to be enabled.
Errors
This will return an Result::Err
variant if:
- we are unable to deserialize the private key or encapsulated key
- there is an error in key decapsulation
- there is an error in decryption