The exception that is thrown is a boost::iostreams::zlib_error. The error code that's found within is -3 which is defined as Z_DATA_ERROR.
Here is another bit: If I remove the zlib compressor/decompressor (leaving only the encrypt/decrypt) and step through it looks like everything is working fine until the last buffer the decryption routine sees -- which it is unable to decrypt back to plain text. Stepping through the encryption routine seems OK to me though (it appears to properly encrypt everything OK). Note again that I can do the reverse: Remove the encrypt/decrypt but keep the compress/decompress and it works fine.