Bug fixes:
1. When encrypt, make sure don't encrypt the last segment as all zeros!
2. When decrypt, don't return error when the decryption len is zero before final as
the ciphertext might be less than the encryption block size.