diff options
Diffstat (limited to 'docs/hazmat/primitives/padding.rst')
-rw-r--r-- | docs/hazmat/primitives/padding.rst | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/hazmat/primitives/padding.rst b/docs/hazmat/primitives/padding.rst index 83154c0d..3056eb92 100644 --- a/docs/hazmat/primitives/padding.rst +++ b/docs/hazmat/primitives/padding.rst @@ -5,7 +5,7 @@ Padding .. currentmodule:: cryptography.hazmat.primitives.padding -Padding is a way to take data that may or may not be be a multiple of the block +Padding is a way to take data that may or may not be a multiple of the block size for a cipher and extend it out so that it is. This is required for many block cipher modes as they require the data to be encrypted to be an exact multiple of the block size. @@ -66,7 +66,16 @@ multiple of the block size. :param bytes data: The data you wish to pass into the context. :return bytes: Returns the data that was padded or unpadded. + :raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`. .. method:: finalize() + Finalize the current context and return the rest of the data. + + After ``finalize`` has been called this object can no longer be used; + :meth:`update` and :meth:`finalize` will raise an + :class:`~cryptography.exceptions.AlreadyFinalized` exception. + :return bytes: Returns the remainder of the data. + :raises ValueError: When trying to remove padding from incorrectly + padded data. |