diff --git a/tests/hazmat/primitives/test_aead.py b/tests/hazmat/primitives/test_aead.py index 79d077065a68..0ea84d0d4070 100644 --- a/tests/hazmat/primitives/test_aead.py +++ b/tests/hazmat/primitives/test_aead.py @@ -389,6 +389,12 @@ def test_data_too_large(self): with pytest.raises(OverflowError): aesgcm.encrypt(nonce, b"", large_data) + def test_decrypt_data_too_short(self): + key = AESGCM.generate_key(128) + aesgcm = AESGCM(key) + with pytest.raises(InvalidTag): + aesgcm.decrypt(b"0" * 12, b"0", None) + def test_vectors(self, backend, subtests): vectors = _load_gcm_vectors() for vector in vectors: