Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# This file is dual licensed under the terms of the Apache License, Version
2# 2.0, and the BSD License. See the LICENSE file in the root of this repository
3# for complete details.
5import abc
6import typing
9# This exists to break an import cycle. It is normally accessible from the
10# ciphers module.
13class CipherAlgorithm(metaclass=abc.ABCMeta):
14 @abc.abstractproperty
15 def name(self) -> str:
16 """
17 A string naming this mode (e.g. "AES", "Camellia").
18 """
20 @abc.abstractproperty
21 def key_sizes(self) -> typing.FrozenSet[int]:
22 """
23 Valid key sizes for this algorithm in bits
24 """
26 @abc.abstractproperty
27 def key_size(self) -> int:
28 """
29 The size of the key being used as an integer in bits (e.g. 128, 256).
30 """
33class BlockCipherAlgorithm(metaclass=abc.ABCMeta):
34 @abc.abstractproperty
35 def block_size(self) -> int:
36 """
37 The size of a block as an integer in bits (e.g. 64, 128).
38 """