OSSL_HPKE_decap

Decapsulate a sender's encapsulated key and derive the shared HPKE secrets.

Synopsis

Declared in <openssl/hpke.h>

int
OSSL_HPKE_decap(
    OSSL_HPKE_CTX* ctx,
    unsigned char const* enc,
    size_t enclen,
    EVP_PKEY* recippriv,
    unsigned char const* info,
    size_t infolen);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
ctxReceiver HPKE context (only one successful call allowed per context).
encEncapsulated public value from OSSL_HPKE_encap().
enclenLength of enc in bytes.
recipprivRecipient private key matching the suite's KEM.
infoOptional application info bound into key schedule, or NULL if infolen is 0.
infolenLength of info in bytes.