-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
type hinting for symmetric ciphers (#5719)
* type hinting for symmetric ciphers * make our interface verifier happy
- Loading branch information
1 parent
576adfb
commit 4372d3f
Showing
6 changed files
with
154 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This file is dual licensed under the terms of the Apache License, Version | ||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository | ||
# for complete details. | ||
|
||
import abc | ||
|
||
|
||
# This exists to break an import cycle. It is normally accessible from the | ||
# ciphers module. | ||
|
||
|
||
class CipherAlgorithm(metaclass=abc.ABCMeta): | ||
@abc.abstractproperty | ||
def name(self): | ||
""" | ||
A string naming this mode (e.g. "AES", "Camellia"). | ||
""" | ||
|
||
@abc.abstractproperty | ||
def key_size(self): | ||
""" | ||
The size of the key being used as an integer in bits (e.g. 128, 256). | ||
""" | ||
|
||
|
||
class BlockCipherAlgorithm(metaclass=abc.ABCMeta): | ||
@abc.abstractproperty | ||
def block_size(self): | ||
""" | ||
The size of a block as an integer in bits (e.g. 64, 128). | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.