aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/hazmat/primitives/padding.rst18
1 files changed, 10 insertions, 8 deletions
diff --git a/docs/hazmat/primitives/padding.rst b/docs/hazmat/primitives/padding.rst
index da5a95dd..83154c0d 100644
--- a/docs/hazmat/primitives/padding.rst
+++ b/docs/hazmat/primitives/padding.rst
@@ -23,16 +23,18 @@ multiple of the block size.
>>> from cryptography.hazmat.primitives import padding
>>> padder = padding.PKCS7(128).padder()
- >>> padder.update(b"1111111111")
- ''
- >>> padded_data = padder.finalize()
+ >>> padded_data = padder.update(b"11111111111111112222222222")
>>> padded_data
- '1111111111\x06\x06\x06\x06\x06\x06'
+ '1111111111111111'
+ >>> padded_data += padder.finalize()
+ >>> padded_data
+ '11111111111111112222222222\x06\x06\x06\x06\x06\x06'
>>> unpadder = padding.PKCS7(128).unpadder()
- >>> unpadder.update(padded_data)
- ''
- >>> unpadder.finalize()
- '1111111111'
+ >>> data = unpadder.update(padded_data)
+ >>> data
+ '1111111111111111'
+ >>> data + unpadder.finalize()
+ '11111111111111112222222222'
:param block_size: The size of the block in bits that the data is being
padded to.