[#EVP_PKEY_decapsulate] = EVP_PKEY_decapsulate :mrdocs: Decapsulate a shared secret from a KEM ciphertext using a context from EVP_PKEY_decapsulate_init(). == Synopsis Declared in `<openssl/evp.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int EVP_PKEY_decapsulate( xref:EVP_PKEY_CTX.adoc[EVP_PKEY_CTX]* ctx, unsigned char* unwrapped, size_t* unwrappedlen, unsigned char const* wrapped, size_t wrappedlen); ---- == Return Value 1 on success, or a non‐positive value on failure. == Parameters [cols="1,4"] |=== | Name| Description | *ctx* | Decapsulation context holding the private key. | *unwrapped* | Buffer for the recovered shared secret, or NULL to query size via `unwrappedlen.` | *unwrappedlen* | On entry, capacity of `unwrapped` when non‐NULL; on return, bytes written or required. | *wrapped* | Encapsulation ciphertext bytes. | *wrappedlen* | Length of `wrapped` in bytes. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#