EVP_EncryptInit_ex2

Initialize a cipher context for encryption with optional OSSL_PARAM settings.

Synopsis

Declared in <openssl/evp.h>

int
EVP_EncryptInit_ex2(
    EVP_CIPHER_CTX* ctx,
    EVP_CIPHER const* cipher,
    unsigned char const* key,
    unsigned char const* iv,
    OSSL_PARAM const params[]);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
ctxCipher context to initialize.
cipherCipher algorithm, or NULL to reuse the previous cipher.
keyEncryption key bytes, or NULL to set later.
ivInitialization vector, or NULL when the cipher does not need one yet.
paramsOptional parameter array terminated by OSSL_PARAM_END, or NULL.