(self, backend, subtests)
| 52 | assert computed_pt == pt |
| 53 | |
| 54 | def test_xts_too_short(self, backend, subtests): |
| 55 | for key in [ |
| 56 | b"thirty_two_byte_keys_are_great!!", |
| 57 | b"\x00" * 32 + b"\x01" * 32, |
| 58 | ]: |
| 59 | with subtests.test(): |
| 60 | key = b"\x00" * 32 + b"\x01" * 32 |
| 61 | mode = modes.XTS(b"\x00" * 16) |
| 62 | alg = algorithms.AES(key) |
| 63 | if not backend.cipher_supported(alg, mode): |
| 64 | pytest.skip(f"AES-{alg.key_size}-XTS not supported") |
| 65 | cipher = base.Cipher(alg, mode) |
| 66 | enc = cipher.encryptor() |
| 67 | with pytest.raises(ValueError): |
| 68 | enc.update(b"0" * 15) |
| 69 | |
| 70 | @pytest.mark.supported( |
| 71 | only_if=lambda backend: not rust_openssl.CRYPTOGRAPHY_IS_LIBRESSL, |
nothing calls this directly
no test coverage detected