Skip to content

Commit

Permalink
Added missing testcase for AESGCM
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jul 7, 2023
1 parent 4e3120c commit a274bfb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/hazmat/primitives/test_aead.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a274bfb

Please sign in to comment.