[#OSSL_HPKE_decap]
= OSSL&lowbar;HPKE&lowbar;decap
:mrdocs:

Decapsulate a sender&apos;s encapsulated key and derive the shared HPKE secrets&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
OSSL&lowbar;HPKE&lowbar;decap(
    xref:OSSL_HPKE_CTX.adoc[OSSL&lowbar;HPKE&lowbar;CTX]* ctx,
    unsigned char const* enc,
    size&lowbar;t enclen,
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* recippriv,
    unsigned char const* info,
    size&lowbar;t infolen);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Receiver HPKE context (only one successful call allowed per context)&period;
| *enc*
| Encapsulated public value from OSSL&lowbar;HPKE&lowbar;encap()&period;
| *enclen*
| Length of `enc` in bytes&period;
| *recippriv*
| Recipient private key matching the suite&apos;s KEM&period;
| *info*
| Optional application info bound into key schedule, or NULL if `infolen` is 0&period;
| *infolen*
| Length of `info` in bytes&period;
|===


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