Initialise ctx for encryption or decryption with cipher.
Declared in <openssl/evp.h>
int
EVP_CipherInit_ex(
EVP_CIPHER_CTX* ctx,
EVP_CIPHER const* cipher,
ENGINE* impl,
unsigned char const* key,
unsigned char const* iv,
int enc);
1 on success, or 0 on error.
| Name | Description |
|---|---|
| ctx | Cipher context to initialise. |
| cipher | Cipher algorithm, or NULL to keep the current cipher and change key/IV/dir. |
| impl | Legacy ENGINE, or NULL for the default implementation. |
| key | Raw key bytes, or NULL to set later. |
| iv | IV/nonce bytes, or NULL when not required / set later. |
| enc | 1 to encrypt, 0 to decrypt, or -1 to leave the direction unchanged. |