Encrypt plaintext with AEAD using secrets derived by a prior OSSL_HPKE_encap().
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);
1 on success, or 0 on error.
| Name | Description |
|---|---|
| ctx | Sender HPKE context after successful encapsulation. |
| ct | Destination ciphertext buffer; on input *ctlen is its capacity. |
| ctlen | In/out ciphertext length (updated with bytes written). |
| aad | Optional additional authenticated data, or NULL if aadlen is 0. |
| aadlen | Length of aad in bytes. |
| pt | Plaintext to encrypt. |
| ptlen | Length of pt in bytes. |