File tree 5 files changed +22
-12
lines changed
src/cryptography/hazmat/primitives
5 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ tests =[
59
59
[tool .coverage .report ]
60
60
exclude_lines = [
61
61
" @abc.abstractmethod" ,
62
- " @abc.abstractproperty" ,
63
62
" @typing.overload" ,
64
63
" if typing.TYPE_CHECKING" ,
65
64
]
Original file line number Diff line number Diff line change 9
9
10
10
11
11
class AsymmetricPadding (metaclass = abc .ABCMeta ):
12
- @abc .abstractproperty
12
+ @property
13
+ @abc .abstractmethod
13
14
def name (self ) -> str :
14
15
"""
15
16
A string naming this padding (e.g. "PSS", "PKCS1").
Original file line number Diff line number Diff line change 10
10
11
11
12
12
class CipherAlgorithm (metaclass = abc .ABCMeta ):
13
- @abc .abstractproperty
13
+ @property
14
+ @abc .abstractmethod
14
15
def name (self ) -> str :
15
16
"""
16
17
A string naming this mode (e.g. "AES", "Camellia").
17
18
"""
18
19
19
- @abc .abstractproperty
20
+ @property
21
+ @abc .abstractmethod
20
22
def key_sizes (self ) -> typing .FrozenSet [int ]:
21
23
"""
22
24
Valid key sizes for this algorithm in bits
23
25
"""
24
26
25
- @abc .abstractproperty
27
+ @property
28
+ @abc .abstractmethod
26
29
def key_size (self ) -> int :
27
30
"""
28
31
The size of the key being used as an integer in bits (e.g. 128, 256).
@@ -32,7 +35,8 @@ def key_size(self) -> int:
32
35
class BlockCipherAlgorithm (metaclass = abc .ABCMeta ):
33
36
key : bytes
34
37
35
- @abc .abstractproperty
38
+ @property
39
+ @abc .abstractmethod
36
40
def block_size (self ) -> int :
37
41
"""
38
42
The size of a block as an integer in bits (e.g. 64, 128).
Original file line number Diff line number Diff line change @@ -170,7 +170,8 @@ def parameter_numbers(self) -> DHParameterNumbers:
170
170
171
171
172
172
class DHPublicKey (metaclass = abc .ABCMeta ):
173
- @abc .abstractproperty
173
+ @property
174
+ @abc .abstractmethod
174
175
def key_size (self ) -> int :
175
176
"""
176
177
The bit length of the prime modulus.
@@ -203,7 +204,8 @@ def public_bytes(
203
204
204
205
205
206
class DHPrivateKey (metaclass = abc .ABCMeta ):
206
- @abc .abstractproperty
207
+ @property
208
+ @abc .abstractmethod
207
209
def key_size (self ) -> int :
208
210
"""
209
211
The bit length of the prime modulus.
Original file line number Diff line number Diff line change 10
10
11
11
12
12
class HashAlgorithm (metaclass = abc .ABCMeta ):
13
- @abc .abstractproperty
13
+ @property
14
+ @abc .abstractmethod
14
15
def name (self ) -> str :
15
16
"""
16
17
A string naming this algorithm (e.g. "sha256", "md5").
17
18
"""
18
19
19
- @abc .abstractproperty
20
+ @property
21
+ @abc .abstractmethod
20
22
def digest_size (self ) -> int :
21
23
"""
22
24
The size of the resulting digest in bytes.
23
25
"""
24
26
25
- @abc .abstractproperty
27
+ @property
28
+ @abc .abstractmethod
26
29
def block_size (self ) -> typing .Optional [int ]:
27
30
"""
28
31
The internal block size of the hash function, or None if the hash
@@ -31,7 +34,8 @@ def block_size(self) -> typing.Optional[int]:
31
34
32
35
33
36
class HashContext (metaclass = abc .ABCMeta ):
34
- @abc .abstractproperty
37
+ @property
38
+ @abc .abstractmethod
35
39
def algorithm (self ) -> HashAlgorithm :
36
40
"""
37
41
A HashAlgorithm that will be used by this context.
You can’t perform that action at this time.
0 commit comments