| 34 | |
| 35 | |
| 36 | class AES(BlockCipherAlgorithm): |
| 37 | name = "AES" |
| 38 | block_size = 128 |
| 39 | # 512 added to support AES-256-XTS, which uses 512-bit keys |
| 40 | key_sizes = frozenset([128, 192, 256, 512]) |
| 41 | |
| 42 | def __init__(self, key: utils.Buffer): |
| 43 | self.key = _verify_key_size(self, key) |
| 44 | |
| 45 | @property |
| 46 | def key_size(self) -> int: |
| 47 | return len(self.key) * 8 |
| 48 | |
| 49 | |
| 50 | class AES128(BlockCipherAlgorithm): |
no outgoing calls