aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/mac
diff options
context:
space:
mode:
authorAdam Goodman <akgood@duosecurity.com>2014-07-23 15:11:46 -0400
committerAdam Goodman <akgood@duosecurity.com>2014-07-23 15:11:46 -0400
commite97ae127f9fc44098f2461a567aa6b9a61e37f5c (patch)
tree671df50035c3daadb26ddb081e36493c610828e5 /docs/hazmat/primitives/mac
parentab3093ffe7dcc058cbd1b22ecb32b715ca47d6d2 (diff)
parentad116e26d102651ab6dc2752ae21afb92b72ad6f (diff)
downloadcryptography-e97ae127f9fc44098f2461a567aa6b9a61e37f5c.tar.gz
cryptography-e97ae127f9fc44098f2461a567aa6b9a61e37f5c.tar.bz2
cryptography-e97ae127f9fc44098f2461a567aa6b9a61e37f5c.zip
Merge branch 'master' into reorder_libs
Diffstat (limited to 'docs/hazmat/primitives/mac')
-rw-r--r--docs/hazmat/primitives/mac/cmac.rst4
-rw-r--r--docs/hazmat/primitives/mac/hmac.rst4
2 files changed, 6 insertions, 2 deletions
diff --git a/docs/hazmat/primitives/mac/cmac.rst b/docs/hazmat/primitives/mac/cmac.rst
index 498b8b1e..1ba1b3fa 100644
--- a/docs/hazmat/primitives/mac/cmac.rst
+++ b/docs/hazmat/primitives/mac/cmac.rst
@@ -45,8 +45,10 @@ A subset of CMAC with the AES-128 algorithm is described in :rfc:`4493`.
To check that a given signature is correct use the :meth:`verify` method.
You will receive an exception if the signature is wrong:
- .. code-block:: pycon
+ .. doctest::
+ >>> c = cmac.CMAC(algorithms.AES(key), backend=default_backend())
+ >>> c.update(b"message to authenticate")
>>> c.verify(b"an incorrect signature")
Traceback (most recent call last):
...
diff --git a/docs/hazmat/primitives/mac/hmac.rst b/docs/hazmat/primitives/mac/hmac.rst
index d56927b9..9ce49c8d 100644
--- a/docs/hazmat/primitives/mac/hmac.rst
+++ b/docs/hazmat/primitives/mac/hmac.rst
@@ -45,8 +45,10 @@ of a message.
To check that a given signature is correct use the :meth:`verify` method.
You will receive an exception if the signature is wrong:
- .. code-block:: pycon
+ .. doctest::
+ >>> h = hmac.HMAC(key, hashes.SHA256(), backend=default_backend())
+ >>> h.update(b"message to hash")
>>> h.verify(b"an incorrect signature")
Traceback (most recent call last):
...