[#OSSL_HPKE_seal]
= OSSL&lowbar;HPKE&lowbar;seal
:mrdocs:

Encrypt plaintext with AEAD using secrets derived by a prior OSSL&lowbar;HPKE&lowbar;encap()&period;

== Synopsis

Declared in `&lt;openssl&sol;hpke&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
OSSL&lowbar;HPKE&lowbar;seal(
    xref:OSSL_HPKE_CTX.adoc[OSSL&lowbar;HPKE&lowbar;CTX]* ctx,
    unsigned char* ct,
    size&lowbar;t* ctlen,
    unsigned char const* aad,
    size&lowbar;t aadlen,
    unsigned char const* pt,
    size&lowbar;t ptlen);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Sender HPKE context after successful encapsulation&period;
| *ct*
| Destination ciphertext buffer&semi; on input &ast;`ctlen` is its capacity&period;
| *ctlen*
| In&sol;out ciphertext length (updated with bytes written)&period;
| *aad*
| Optional additional authenticated data, or NULL if `aadlen` is 0&period;
| *aadlen*
| Length of `aad` in bytes&period;
| *pt*
| Plaintext to encrypt&period;
| *ptlen*
| Length of `pt` in bytes&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
