(mode, alg_cls, backend)
| 307 | ) |
| 308 | @pytest.mark.parametrize("alg_cls", [algorithms.AES128, algorithms.AES256]) |
| 309 | def test_alternate_aes_classes(mode, alg_cls, backend): |
| 310 | alg = alg_cls(b"0" * (alg_cls.key_size // 8)) |
| 311 | if not backend.cipher_supported(alg, mode): |
| 312 | pytest.skip(f"AES in {mode.name} mode not supported") |
| 313 | data = bytearray(b"sixteen_byte_msg") |
| 314 | cipher = base.Cipher(alg, mode, backend) |
| 315 | enc = cipher.encryptor() |
| 316 | ct = enc.update(data) + enc.finalize() |
| 317 | dec = cipher.decryptor() |
| 318 | pt = dec.update(ct) + dec.finalize() |
| 319 | assert pt == data |
| 320 | |
| 321 | |
| 322 | def test_reset_nonce(backend): |
nothing calls this directly
no test coverage detected