diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-12-19 18:10:33 -0800 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-12-19 18:10:33 -0800 |
commit | 9b9318d79ba5927603b120411d13b607938cae56 (patch) | |
tree | 811558715e1e1ec9dd91c0ec9c8e21684c1a1531 | |
parent | cde832d298687a0623b67aeda674635bf1bcdf77 (diff) | |
parent | 764b54a5b1b3e8d6f5d7c2b72a5fdf00b0d805b3 (diff) | |
download | cryptography-9b9318d79ba5927603b120411d13b607938cae56.tar.gz cryptography-9b9318d79ba5927603b120411d13b607938cae56.tar.bz2 cryptography-9b9318d79ba5927603b120411d13b607938cae56.zip |
Merge pull request #321 from alex/docstring-cleanup
Clean up some docstrings
-rw-r--r-- | cryptography/hazmat/primitives/interfaces.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 2a1a21b8..e87c9ca9 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -22,13 +22,13 @@ class CipherAlgorithm(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def name(self): """ - A string naming this mode. (e.g. AES, Camellia) + 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) + The size of the key being used as an integer in bits (e.g. 128, 256). """ @@ -36,7 +36,7 @@ class BlockCipherAlgorithm(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def block_size(self): """ - The size of a block as an integer in bits. (e.g. 64, 128) + The size of a block as an integer in bits (e.g. 64, 128). """ @@ -44,7 +44,7 @@ class Mode(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def name(self): """ - A string naming this mode. (e.g. ECB, CBC) + A string naming this mode (e.g. "ECB", "CBC"). """ @@ -76,13 +76,14 @@ class CipherContext(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def update(self, data): """ - update takes bytes and return bytes + Processes the provided bytes through the cipher and returns the results + as bytes. """ @abc.abstractmethod def finalize(self): """ - finalize return bytes + Returns the results of processing the final block as bytes. """ @@ -90,7 +91,7 @@ class AEADCipherContext(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def authenticate_additional_data(self, data): """ - authenticate_additional_data takes bytes and returns nothing. + Authenticates the provided bytes. """ @@ -98,7 +99,8 @@ class AEADEncryptionContext(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def tag(self): """ - Returns tag bytes after finalizing encryption. + Returns tag bytes. This is only available after encryption is + finalized. """ @@ -106,13 +108,13 @@ class PaddingContext(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def update(self, data): """ - update takes bytes and return bytes + Pads the provided bytes and returns any available data as bytes. """ @abc.abstractmethod def finalize(self): """ - finalize return bytes + Finalize the padding, returns bytes. """ @@ -120,7 +122,7 @@ class HashAlgorithm(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def name(self): """ - A string naming this algorithm. (e.g. sha256, md5) + A string naming this algorithm (e.g. "sha256", "md5"). """ @abc.abstractproperty @@ -146,17 +148,17 @@ class HashContext(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def update(self, data): """ - hash data as bytes + Processes the provided bytes through the hash. """ @abc.abstractmethod def finalize(self): """ - finalize this copy of the hash and return the digest as bytes. + Finalizes the hash context and returns the hash digest as bytes. """ @abc.abstractmethod def copy(self): """ - return a HashContext that is a copy of the current context. + Return a HashContext that is a copy of the current context. """ |