Function hpke_dispatch::base_mode_seal
source · pub fn base_mode_seal(
config: &Config,
recipient_public_key: &[u8],
info: &[u8],
plaintext: &[u8],
aad: &[u8]
) -> Result<EncappedKeyAndCiphertext, HpkeError>
Expand description
base_mode_seal
provides an interface to hpke::single_shot_seal
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-seal
crate feature to be enabled.
Errors
This will return an Result::Err
variant if:
- we are unable to deserialize the recipient public key
- there is an error in key encapsultion
- there is an error in encryption