pub enum Mode<'a> {
Base,
PreSharedKey {
pre_shared_key: &'a [u8],
pre_shared_key_id: &'a [u8],
},
}Expand description
The HPKE session mode, shared by the sender and recipient roles.
The mode selects whether the key schedule is bound to a pre-shared key
(Mode::PreSharedKey) or not (Mode::Base).
Pre-shared key bytes and their identifier are carried together, so the inconsistent inputs rejected by the specification cannot be expressed.
draft-ietf-hpke-hpke-05 removed the asymmetric authenticated modes of
RFC 9180 (mode_auth and mode_auth_psk). For sender identity
authentication, sign the (encapped_key, ciphertext) tuple (see the crate
documentation); a pre-shared key only proves possession of the key.
Variants§
Base
No sender authentication.
Pre-shared key mode: the shared key is mixed into the key schedule, proving possession of it. This does not authenticate a sender identity.