I seem to be getting an extra block of output for AES-128 in CBC and ECB modes when using the EVP_EncryptUpdate mode. When using the BIO interface it appears to work fine, and if I leave padding enabled and provide less than 1 block of input (15 bytes instead of 16) then it seems to work fine.
I've attached a small program to demonstrate this behavior. When run with OpenSSL 0.9.8 (up through and including g), the EVP_Encrypt output for AES-128- CBC and AES-128-ECB modes are 32 bytes, but all other output is 16 bytes. Is this a bug, feature, or an error on my part? If this is a bug, would it be reasonable to assume the extra block for the above two modes is unneeded (I can ensure my input is always a block-multiple) and automatically strip it? I'd prefer to avoid the BIO interface due to the higher performance (as calculated at the end of the attached test program, the BIO interface is nearly 5x slower than the EVP_EncryptUpdate). Thanks! -Kevin ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/
blocksize_symtest.cpp
Description: Binary data