OSSL_HPKE_seal

Encrypt plaintext with AEAD using secrets derived by a prior OSSL_HPKE_encap().

Synopsis

Declared in <openssl/hpke.h>

int
OSSL_HPKE_seal(
    OSSL_HPKE_CTX* ctx,
    unsigned char* ct,
    size_t* ctlen,
    unsigned char const* aad,
    size_t aadlen,
    unsigned char const* pt,
    size_t ptlen);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
ctxSender HPKE context after successful encapsulation.
ctDestination ciphertext buffer; on input *ctlen is its capacity.
ctlenIn/out ciphertext length (updated with bytes written).
aadOptional additional authenticated data, or NULL if aadlen is 0.
aadlenLength of aad in bytes.
ptPlaintext to encrypt.
ptlenLength of pt in bytes.