Function hpke::SetupBaseS
source · [−]pub fn SetupBaseS(
config: HPKEConfig,
pkR: &HpkePublicKey,
info: &Info,
randomness: Randomness
) -> SenderContextResult
Expand description
Encryption to a Public Key - Sender
The most basic function of an HPKE scheme is to enable encryption to the
holder of a given KEM private key. The SetupBaseS()
and SetupBaseR()
procedures establish contexts that can be used to encrypt and decrypt,
respectively, for a given private key. The KEM shared secret is combined via
the KDF with information describing the key exchange, as well as the explicit
info parameter provided by the caller.The parameter pkR is a public key,
and enc is an encapsulated KEM shared secret.
def SetupBaseS(pkR, info):
shared_secret, enc = Encap(pkR)
return enc, KeyScheduleS(mode_base, shared_secret, info,
default_psk, default_psk_id)