From d1f0201fd80659395a8444efe11ba24473c212e5 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 1 Nov 2013 14:12:35 -0700 Subject: Document how this returns bytes --- docs/hazmat/primitives/symmetric-encryption.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst index 5852dc21..a0e76506 100644 --- a/docs/hazmat/primitives/symmetric-encryption.rst +++ b/docs/hazmat/primitives/symmetric-encryption.rst @@ -63,6 +63,11 @@ where the encrypter and decrypter both use the same key. :param bytes data: The data you wish to pass into the context. :return bytes: Returns the data that was encrypted or decrypted. + When the ``BlockCipher`` was constructed in a mode turns it into a + stream cipher, this will return bytes immediately, however in other + modes it will return blocks in chunks, whose size is determined by the + cipher's block size. + .. method:: finalize() :return bytes: Returns the remainder of the data. @@ -162,7 +167,8 @@ Modes block size of less than 128-bits. CTR (Counter) is a mode of operation for block ciphers. It is considered - cryptographically strong. + cryptographically strong. It transforms a block cipher into a stream + cipher. :param bytes nonce: Should be random bytes. It is critical to never reuse a ``nonce`` with a given key. Any reuse of a nonce -- cgit v1.2.3 From fc09a7cb78591ad0bf5ee0116c85dcee6d47502c Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 1 Nov 2013 14:43:02 -0700 Subject: For example --- docs/hazmat/primitives/symmetric-encryption.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst index a0e76506..f68979a3 100644 --- a/docs/hazmat/primitives/symmetric-encryption.rst +++ b/docs/hazmat/primitives/symmetric-encryption.rst @@ -64,9 +64,10 @@ where the encrypter and decrypter both use the same key. :return bytes: Returns the data that was encrypted or decrypted. When the ``BlockCipher`` was constructed in a mode turns it into a - stream cipher, this will return bytes immediately, however in other - modes it will return blocks in chunks, whose size is determined by the - cipher's block size. + stream cipher (e.g. + :class:`cryptography.hazmat.primitives.block.modes.CTR`), this will + return bytes immediately, however in other modes it will return blocks + in chunks, whose size is determined by the cipher's block size. .. method:: finalize() -- cgit v1.2.3 From bf2de7458aebbc6bc855e9f145cf9a40ceec033e Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 1 Nov 2013 14:48:19 -0700 Subject: better english --- docs/hazmat/primitives/symmetric-encryption.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst index f68979a3..b8b1c839 100644 --- a/docs/hazmat/primitives/symmetric-encryption.rst +++ b/docs/hazmat/primitives/symmetric-encryption.rst @@ -66,8 +66,8 @@ where the encrypter and decrypter both use the same key. When the ``BlockCipher`` was constructed in a mode turns it into a stream cipher (e.g. :class:`cryptography.hazmat.primitives.block.modes.CTR`), this will - return bytes immediately, however in other modes it will return blocks - in chunks, whose size is determined by the cipher's block size. + return bytes immediately, however in other modes it will return chunks, + whose size is determined by the cipher's block size. .. method:: finalize() -- cgit v1.2.3