[#EVP_DecryptInit_ex2]
= EVP&lowbar;DecryptInit&lowbar;ex2
:mrdocs:

Initialize `ctx` for decryption with `cipher,` `key,` `iv,` and optional parameters&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
EVP&lowbar;DecryptInit&lowbar;ex2(
    xref:EVP_CIPHER_CTX.adoc[EVP&lowbar;CIPHER&lowbar;CTX]* ctx,
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER] const* cipher,
    unsigned char const* key,
    unsigned char const* iv,
    xref:OSSL_PARAM.adoc[OSSL&lowbar;PARAM] const params[]);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Cipher context to (re)initialize&period;
| *cipher*
| Cipher algorithm, or NULL to reuse the algorithm already associated with `ctx&period;`
| *key*
| Decryption key bytes, or NULL to set the cipher without a key yet&period;
| *iv*
| Initialization vector, or NULL when unused or set later&period;
| *params*
| Optional OSSL&lowbar;PARAM array applied after initialization, or NULL&period;
|===


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