Allocate cipher with EVP_CIPHER_CTX_new. Thanks @Adam- for the tip.