OSSL_HPKE_open

Decrypt ciphertext with AEAD using secrets derived by a prior OSSL_HPKE_decap().

Synopsis

Declared in <openssl/hpke.h>

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

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
ctxReceiver HPKE context after successful decapsulation.
ptDestination plaintext buffer; on input *ptlen is its capacity.
ptlenIn/out plaintext length (updated with bytes written).
aadOptional additional authenticated data, or NULL if aadlen is 0.
aadlenLength of aad in bytes.
ctCiphertext to decrypt (same order as produced by OSSL_HPKE_seal()).
ctlenLength of ct in bytes.