OSSL_HPKE_encap

Encapsulate to a recipient public key and derive sender HPKE secrets.

Synopsis

Declared in <openssl/hpke.h>

int
OSSL_HPKE_encap(
    OSSL_HPKE_CTX* ctx,
    unsigned char* enc,
    size_t* enclen,
    unsigned char const* pub,
    size_t publen,
    unsigned char const* info,
    size_t infolen);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
ctxSender HPKE context (only one successful call allowed per context).
encDestination for the encapsulated public value; on input *enclen is capacity.
enclenIn/out length of enc (updated with bytes written).
pubRecipient public key octets for the suite's KEM.
publenLength of pub in bytes.
infoOptional application info bound into key schedule, or NULL if infolen is 0.
infolenLength of info in bytes (must not exceed OSSL_HPKE_MAX_INFOLEN).