EVP_CIPHER_CTX_INIT(3)

NAME
EVP_CIPHER_CTX_init, EVP_CIPHER_CTX_cleanup, EVP_Cipher - obsolete EVP cipher functions

SYNOPSIS
#include <openssl/evp.h>
void
EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx);
int
EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *ctx);
int
EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl);

DESCRIPTION
EVP_CIPHER_CTX_init() is a deprecated function to clear a cipher context on the stack before use. Do not use it on a cipher context returned from EVP_CIPHER_CTX_new(3) or one that was already used.

EVP_CIPHER_CTX_cleanup() is a deprecated alias for EVP_CIPHER_CTX_reset(3). It clears all information from ctx and frees all allocated memory associated with it, except the ctx object itself.

EVP_Cipher() encrypts or decrypts aligned blocks of data whose lengths match the cipher block size. It requires that the previous encryption or decryption operation using the same ctx, if there was any, ended exactly on a block boundary and that inl is an integer multiple of the cipher block size. If either of these conditions is violated, EVP_Cipher() silently produces incorrect results. For that reason, using the function EVP_CipherUpdate(3) instead is strongly recommended. The latter can safely handle partial blocks, and even if inl actually is a multiple of the cipher block size for all calls, the overhead incurred by using EVP_CipherUpdate(3) is minimal.

RETURN VALUES
EVP_CIPHER_CTX_cleanup() and EVP_Cipher() return 1 for success or 0 for failure.

SEE ALSO
evp(3), EVP_EncryptInit(3)

HISTORY
EVP_Cipher() first appeared in SSLeay 0.6.5. EVP_CIPHER_CTX_cleanup() first appeared in SSLeay 0.8.0. EVP_CIPHER_CTX_init() first appeared in SSLeay 0.9.0. All these functions have been available since OpenBSD 2.4.