MCPcopy
hub / github.com/pyca/cryptography / test_data_too_large

Method test_data_too_large

tests/hazmat/primitives/test_aead.py:1259–1273  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1257 reason="mmap and 64-bit platform required",
1258 )
1259 def test_data_too_large(self):
1260 key = AESGCMSIV.generate_key(256)
1261 nonce = os.urandom(12)
1262 aesgcmsiv = AESGCMSIV(key)
1263
1264 large_data = large_mmap()
1265
1266 with pytest.raises(OverflowError):
1267 aesgcmsiv.encrypt(nonce, large_data, None)
1268
1269 with pytest.raises(OverflowError):
1270 aesgcmsiv.encrypt(nonce, b"irrelevant", large_data)
1271
1272 with pytest.raises(OverflowError):
1273 aesgcmsiv.decrypt(nonce, b"very very irrelevant", large_data)
1274
1275 def test_invalid_nonce_length(self, backend):
1276 key = AESGCMSIV.generate_key(128)

Callers

nothing calls this directly

Calls 4

large_mmapFunction · 0.85
generate_keyMethod · 0.80
encryptMethod · 0.45
decryptMethod · 0.45

Tested by

no test coverage detected