aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-22 16:54:55 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-22 16:54:55 -0800
commitbae899ad36bcb99dbec94aaf026ef1650f2b1242 (patch)
treee81941130005701cee0139d57f53b817224fefd2 /docs/hazmat
parente247d0be584c52e25694918ad2345dadde3fefa9 (diff)
downloadcryptography-bae899ad36bcb99dbec94aaf026ef1650f2b1242.tar.gz
cryptography-bae899ad36bcb99dbec94aaf026ef1650f2b1242.tar.bz2
cryptography-bae899ad36bcb99dbec94aaf026ef1650f2b1242.zip
Change teh exception
Diffstat (limited to 'docs/hazmat')
-rw-r--r--docs/hazmat/primitives/padding.rst8
-rw-r--r--docs/hazmat/primitives/symmetric-encryption.rst10
2 files changed, 10 insertions, 8 deletions
diff --git a/docs/hazmat/primitives/padding.rst b/docs/hazmat/primitives/padding.rst
index aebb4d4d..4d79ac8f 100644
--- a/docs/hazmat/primitives/padding.rst
+++ b/docs/hazmat/primitives/padding.rst
@@ -25,8 +25,14 @@ multiple of the block size.
>>> padder = padding.PKCS7(128).padder()
>>> padder.update(b"1111111111")
''
- >>> padder.finalize()
+ >>> padded_data = padder.finalize()
+ >>> padded_data
'1111111111\x06\x06\x06\x06\x06\x06'
+ >>> unpadder = padding.PKCS7(128).unpadder()
+ >>> unpadder.update(padded_data)
+ ''
+ >>> unpadder.finalize()
+ '1111111111'
:param block_size: The size of the block in bits that the data is being
padded to.
diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst
index 35b0d9a8..732af33c 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -99,13 +99,9 @@ an "encrypt-then-MAC" formulation as `described by Colin Percival`_.
.. method:: finalize()
:return bytes: Returns the remainder of the data.
- :raises cryptography.exceptions.IncorrectPadding: This is raised when
- the data provided
- isn't correctly
- padded to be a
- multiple of the
- algorithm's block
- size.
+ :raises ValueError: This is raised when the data provided isn't
+ correctly padded to be a multiple of the
+ algorithm's block size.
Once ``finalize`` is called this object can no longer be used and
:meth:`update` and :meth:`finalize` will raise