[#EVP_CipherInit_ex2] = EVP_CipherInit_ex2 :mrdocs: Initialise a cipher context with optional OSSL_PARAM settings. == Synopsis Declared in `<openssl/evp.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int EVP_CipherInit_ex2( xref:EVP_CIPHER_CTX.adoc[EVP_CIPHER_CTX]* ctx, xref:EVP_CIPHER-07.adoc[EVP_CIPHER] const* cipher, unsigned char const* key, unsigned char const* iv, int enc, xref:OSSL_PARAM.adoc[OSSL_PARAM] const params[]); ---- == Return Value 1 on success, or 0 on failure. == Parameters [cols="1,4"] |=== | Name| Description | *ctx* | Cipher context to initialise. | *cipher* | Cipher algorithm, or NULL to reuse the one already in `ctx.` | *key* | Key bytes, or NULL to set later. | *iv* | IV/nonce bytes, or NULL when not yet available / not required. | *enc* | 1 to encrypt, 0 to decrypt, or ‐1 to leave the prior direction. | *params* | Optional parameter array terminated by OSSL_PARAM_END, or NULL. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#