def test_gcm_dec_badiv(aesenc):
    aes, enc, ciphertext, tag = aesenc
    dec = aes.dec(key=b"A"*16, iv=b"B"*16)
    dec.update_associated(b"Hello")
    plaintext = dec.update(ciphertext)

    dec.set_tag(tag)

    with pytest.raises(Exception) as excinfo:
        dec.finalize()
    assert "Cipher" in str(excinfo.value)
dataset/ETHPy150Open gdanezis/petlib/petlib/cipher.py/test_gcm_dec_badiv/original