Use 0 not -1 (since type is size_t) for finalisation argument to do_cipher: