From c6f195607ecce2419e477f44de4248b4e61212df Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 27 Apr 2014 09:54:11 -0500 Subject: document exceptions for padding --- docs/hazmat/primitives/padding.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/hazmat/primitives/padding.rst b/docs/hazmat/primitives/padding.rst index 3056eb92..4092ac00 100644 --- a/docs/hazmat/primitives/padding.rst +++ b/docs/hazmat/primitives/padding.rst @@ -38,6 +38,8 @@ multiple of the block size. :param block_size: The size of the block in bits that the data is being padded to. + :raises ValueError: Raised if block size is not a multiple of 8 or is not + between 0 and 256. .. method:: padder() @@ -66,6 +68,7 @@ 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 TypeError: Raised if data is not bytes. :raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`. .. method:: finalize() @@ -77,5 +80,6 @@ multiple of the block size. :class:`~cryptography.exceptions.AlreadyFinalized` exception. :return bytes: Returns the remainder of the data. + :raises TypeError: Raised if data is not bytes. :raises ValueError: When trying to remove padding from incorrectly padded data. -- cgit v1.2.3