"Typical uses for something like libmcrypt is to encrypt a plaintext for decryption at some later date. All that should be required for the decryption is the key that was used during encryption. In particular, the values in the IV array cannot be expected to be the same during encryption and decryption.
[...] If however, I modify the test program as per the patch below, so that the IV array is different for encryption and decryption, then many of the tests fail."