def test_encrypt_invalid_iv_length(self): data = b'3' * 16 key = b'x' * 16 iv = b'i' * 0 with pytest.raises(ValueError): enc(data, key, iv)
def test_encrypt_invalid_data_length(self): data = b'r' * 8 key = b'x' * 16 iv = b'i' * 16 with pytest.raises(ValueError): enc(data, key, iv)
def test_encrypt(self): data = b'x' * 16 key = b'a' * 16 iv = b'0' * 16 result = enc(data, key, iv) assert len(result) == 16 assert type(result) == bytes
def test_decrypt(self): data = b'x' * 16 key = b'a' * 16 iv = b'0' * 16 encrypted = enc(data, key, iv) result = dec(encrypted, key, iv) assert len(result) == 16