[#OSSL_HPKE_encap] = OSSL_HPKE_encap :mrdocs: Encapsulate to a recipient public key and derive sender HPKE secrets. == Synopsis Declared in `<openssl/hpke.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int OSSL_HPKE_encap( xref:OSSL_HPKE_CTX.adoc[OSSL_HPKE_CTX]* ctx, unsigned char* enc, size_t* enclen, unsigned char const* pub, size_t publen, unsigned char const* info, size_t infolen); ---- == Return Value 1 on success, or 0 on error. == Parameters [cols="1,4"] |=== | Name| Description | *ctx* | Sender HPKE context (only one successful call allowed per context). | *enc* | Destination for the encapsulated public value; on input *`enclen` is capacity. | *enclen* | In/out length of `enc` (updated with bytes written). | *pub* | Recipient public key octets for the suite's KEM. | *publen* | Length of `pub` in bytes. | *info* | Optional application info bound into key schedule, or NULL if `infolen` is 0. | *infolen* | Length of `info` in bytes (must not exceed OSSL_HPKE_MAX_INFOLEN). |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#