On Mon, Jun 26, 2017, Brett R. Nicholas wrote: > AFAIK (and please correct me if this is wrong) my init_key function is > invoked by the EVP interface when I call the EVP_[En/De]cryptInit_ex > function, and the do_cipher function is called upon EVP_[En/De]cryptUpdate. > But how should I handle the EVP_[En/De]cryptFinal functions? Should I not be > implementing them in my engine? Or am I missing something here.... >
The do_cipher function is normally the low level block cipher function: it gets handed a multiple of the block size to encrypt/decrypt. The higher level EVP_EncryptUpdate and EVP_EncryptFinal functions perform padding and buffering internally and call the do_cipher function to encrypt a multiple of the block size. I saw "normally" because it is possible to specify the flag EVP_CIPH_FLAG_CUSTOM_CIPHER in the EVP_CIPHER structure and handle padding internally. Steve. -- Dr Stephen N. Henson. OpenSSL project core developer. Commercial tech support now available see: http://www.openssl.org -- openssl-dev mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev