Function hpke::setup_sender

source ·
pub fn setup_sender<A, Kdf, Kem, R>(
    mode: &OpModeS<'_, Kem>,
    pk_recip: &Kem::PublicKey,
    info: &[u8],
    csprng: &mut R
) -> Result<(Kem::EncappedKey, AeadCtxS<A, Kdf, Kem>), HpkeError>where
    A: Aead,
    Kdf: KdfTrait,
    Kem: KemTrait,
    R: CryptoRng + RngCore,
Expand description

Initiates an encryption context to the given recipient public key

Return Value

On success, returns an encapsulated public key (intended to be sent to the recipient), and an encryption context. If an error happened during key encapsulation, returns Err(HpkeError::EncapError). This is the only possible error.