diff options
author | Cédric Krier <ced@b2ck.com> | 2016-02-27 15:09:06 +0100 |
---|---|---|
committer | Cédric Krier <ced@b2ck.com> | 2016-02-27 23:45:46 +0100 |
commit | 89d47907f112be41a9ea4e684af24d5a74c14336 (patch) | |
tree | 8b02b7770197ca03fc0b7bcf42cde71d25ed582b /src | |
parent | 94f9ea25b50a3dd2592abfc63385989955e60e68 (diff) | |
download | cryptography-89d47907f112be41a9ea4e684af24d5a74c14336.tar.gz cryptography-89d47907f112be41a9ea4e684af24d5a74c14336.tar.bz2 cryptography-89d47907f112be41a9ea4e684af24d5a74c14336.zip |
Make _padding and _check_padding abstractmethod
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/primitives/padding.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cryptography/hazmat/primitives/padding.py b/src/cryptography/hazmat/primitives/padding.py index 81883404..c6fe656e 100644 --- a/src/cryptography/hazmat/primitives/padding.py +++ b/src/cryptography/hazmat/primitives/padding.py @@ -39,6 +39,7 @@ class _BytePadding(object): self.block_size = block_size +@six.add_metaclass(abc.ABCMeta) class _BytePaddingContext(object): def __init__(self, block_size): self.block_size = block_size @@ -61,8 +62,11 @@ class _BytePaddingContext(object): return result + @abc.abstractmethod def _padding(self, size): - return NotImplemented + """ + Returns the padding for the size. + """ def finalize(self): if self._buffer is None: @@ -74,6 +78,7 @@ class _BytePaddingContext(object): return result +@six.add_metaclass(abc.ABCMeta) class _ByteUnpaddingContext(object): def __init__(self, block_size): self.block_size = block_size @@ -99,8 +104,11 @@ class _ByteUnpaddingContext(object): return result + @abc.abstractmethod def _check_padding(self): - return NotImplemented + """ + Returns if the padding is valid. + """ def finalize(self): if self._buffer is None: |