Hello I'm sorry when there is an impoliteness. I want you to tell me a *correct way to* call the EVP_CIPHER_CTX_cleanup().
I'm writing the program for encrypt independent data one by one. Should I call EVP_CIPHER_CTX_cleanup() at each EVP_EncryptFinal_ex() to "Context"? function(){ EVP_CIPHER_CTX ctx; while( File exists ) { EVP_CIPHER_CTX_init( &ctx ) EVP_CIPHER_CTX_set_padding( &ctx ) EVP_EncryptInit_ex( &ctx ) EVP_EncryptUpdate( &ctx ) EVP_EncryptFinal_ex( &ctx ) EVP_CIPHER_CTX_cleanup( &ctx ) } } Or, May I call the encryption processing repeatedly by once EVP_CIPHER_CTX_init() and EVP_CIPHER_CTX_cleanup() to "Context"? function(){ EVP_CIPHER_CTX ctx; EVP_CIPHER_CTX_init( &ctx ) EVP_CIPHER_CTX_set_padding( &ctx ) while( File exists ) { EVP_EncryptInit_ex( &ctx ) EVP_EncryptUpdate( &ctx ) EVP_EncryptFinal_ex( &ctx ) } EVP_CIPHER_CTX_cleanup( &ctx ) } I confirmed the above-mentioned both operated, too. However, I want to know a correct specification, but I worry about the meaning of the following sentence of manual. # EVP_CIPHER_CTX_cleanup() clears all information from a # cipher context and free up any allocated memory associate # with it. It should be called after all operations using a # cipher are complete so sensitive information does not remain # in memory. I appreciate any comments and suggestions. Regards Tos