"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
- The IV for encryption and decryption should always be the same.
- But it does not need to be secret, only unique and random.