aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat
diff options
context:
space:
mode:
Diffstat (limited to 'docs/hazmat')
-rw-r--r--docs/hazmat/primitives/constant-time.rst3
-rw-r--r--docs/hazmat/primitives/cryptographic-hashes.rst3
-rw-r--r--docs/hazmat/primitives/key-derivation-functions.rst21
-rw-r--r--docs/hazmat/primitives/mac/cmac.rst6
-rw-r--r--docs/hazmat/primitives/mac/hmac.rst6
-rw-r--r--docs/hazmat/primitives/padding.rst3
6 files changed, 42 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/constant-time.rst b/docs/hazmat/primitives/constant-time.rst
index c6fcb3a3..3296dbde 100644
--- a/docs/hazmat/primitives/constant-time.rst
+++ b/docs/hazmat/primitives/constant-time.rst
@@ -36,6 +36,9 @@ about the timing attacks on KeyCzar and Java's ``MessageDigest.isEqual()``.
:param bytes b: The right-hand side.
:returns bool: ``True`` if ``a`` has the same bytes as ``b``, otherwise
``False``.
+ :raises TypeError: This exception is raised if ``a`` or ``b`` is not a
+ binary type. This is ``str`` in Python 2 and ``bytes``
+ in Python 3.
.. _`Coda Hale's blog post`: http://codahale.com/a-lesson-in-timing-attacks/
diff --git a/docs/hazmat/primitives/cryptographic-hashes.rst b/docs/hazmat/primitives/cryptographic-hashes.rst
index 773d97f6..43dee3f3 100644
--- a/docs/hazmat/primitives/cryptographic-hashes.rst
+++ b/docs/hazmat/primitives/cryptographic-hashes.rst
@@ -54,6 +54,9 @@ Message digests
:param bytes data: The bytes to be hashed.
:raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`.
+ :raises TypeError: This exception is raised if ``data`` is not a binary
+ type. This is ``str`` in Python 2 and ``bytes`` in
+ Python 3.
.. method:: copy()
diff --git a/docs/hazmat/primitives/key-derivation-functions.rst b/docs/hazmat/primitives/key-derivation-functions.rst
index de6bf5f8..c9c0c3cc 100644
--- a/docs/hazmat/primitives/key-derivation-functions.rst
+++ b/docs/hazmat/primitives/key-derivation-functions.rst
@@ -88,6 +88,10 @@ Different KDFs are suitable for different tasks such as:
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.PBKDF2HMACBackend`
+ :raises TypeError: This exception is raised if ``salt`` is not a binary
+ type. This is ``str`` in Python 2 and ``bytes`` in
+ Python 3.
+
.. method:: derive(key_material)
:param bytes key_material: The input key material. For PBKDF2 this
@@ -99,6 +103,10 @@ Different KDFs are suitable for different tasks such as:
called more than
once.
+ :raises TypeError: This exception is raised if ``key_material`` is not
+ a binary type. This is ``str`` in Python 2 and
+ ``bytes`` in Python 3.
+
This generates and returns a new key from the supplied password.
.. method:: verify(key_material, expected_key)
@@ -191,10 +199,17 @@ Different KDFs are suitable for different tasks such as:
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`
+ :raises TypeError: This exception is raised if ``salt`` or ``info`` is not
+ a binary type. This is ``str`` in Python 2 and ``bytes``
+ in Python 3.
+
.. method:: derive(key_material)
:param bytes key_material: The input key material.
:return bytes: The derived key.
+ :raises TypeError: This exception is raised if ``key_material`` is not
+ a binary type. This is ``str`` in Python 2 and
+ ``bytes`` in Python 3.
Derives a new key from the input key material by performing both the
extract and expand operations.
@@ -277,6 +292,9 @@ Different KDFs are suitable for different tasks such as:
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`
:raises TypeError: This is raised if the provided ``info`` is a unicode object
+ :raises TypeError: This exception is raised if ``info`` is not a binary
+ type. This is ``str`` in Python 2 and ``bytes`` in
+ Python 3.
.. method:: derive(key_material)
@@ -285,6 +303,9 @@ Different KDFs are suitable for different tasks such as:
:raises TypeError: This is raised if the provided ``key_material`` is
a unicode object
+ :raises TypeError: This exception is raised if ``key_material`` is not
+ a binary type. This is ``str`` in Python 2 and
+ ``bytes`` in Python 3.
Derives a new key from the input key material by performing both the
extract and expand operations.
diff --git a/docs/hazmat/primitives/mac/cmac.rst b/docs/hazmat/primitives/mac/cmac.rst
index 1fde1398..86c3b6a9 100644
--- a/docs/hazmat/primitives/mac/cmac.rst
+++ b/docs/hazmat/primitives/mac/cmac.rst
@@ -68,6 +68,9 @@ A subset of CMAC with the AES-128 algorithm is described in :rfc:`4493`.
:param bytes data: The bytes to hash and authenticate.
:raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`
+ :raises TypeError: This exception is raised if ``data`` is not a binary
+ type. This is ``str`` in Python 2 and ``bytes`` in
+ Python 3.
.. method:: copy()
@@ -89,6 +92,9 @@ A subset of CMAC with the AES-128 algorithm is described in :rfc:`4493`.
:raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`
:raises cryptography.exceptions.InvalidSignature: If signature does not
match digest
+ :raises TypeError: This exception is raised if ``signature`` is not a
+ binary type. This is ``str`` in Python 2 and
+ ``bytes`` in Python 3.
.. method:: finalize()
diff --git a/docs/hazmat/primitives/mac/hmac.rst b/docs/hazmat/primitives/mac/hmac.rst
index e20a4034..0fc4a19a 100644
--- a/docs/hazmat/primitives/mac/hmac.rst
+++ b/docs/hazmat/primitives/mac/hmac.rst
@@ -69,6 +69,9 @@ of a message.
:param bytes msg: The bytes to hash and authenticate.
:raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`
+ :raises TypeError: This exception is raised if ``msg`` is not a binary
+ type. This is ``str`` in Python 2 and ``bytes`` in
+ Python 3.
.. method:: copy()
@@ -90,6 +93,9 @@ of a message.
:raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`
:raises cryptography.exceptions.InvalidSignature: If signature does not
match digest
+ :raises TypeError: This exception is raised if ``signature`` is not a
+ binary type. This is ``str`` in Python 2 and
+ ``bytes`` in Python 3.
.. method:: finalize()
diff --git a/docs/hazmat/primitives/padding.rst b/docs/hazmat/primitives/padding.rst
index 4092ac00..72378e1f 100644
--- a/docs/hazmat/primitives/padding.rst
+++ b/docs/hazmat/primitives/padding.rst
@@ -70,6 +70,9 @@ multiple of the block size.
: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`.
+ :raises TypeError: This exception is raised if ``data`` is not a binary
+ type. This is ``str`` in Python 2 and ``bytes`` in
+ Python 3.
.. method:: finalize()