diff options
author | Adam Goodman <akgood@duosecurity.com> | 2014-07-23 15:11:46 -0400 |
---|---|---|
committer | Adam Goodman <akgood@duosecurity.com> | 2014-07-23 15:11:46 -0400 |
commit | e97ae127f9fc44098f2461a567aa6b9a61e37f5c (patch) | |
tree | 671df50035c3daadb26ddb081e36493c610828e5 /docs/hazmat/primitives/mac | |
parent | ab3093ffe7dcc058cbd1b22ecb32b715ca47d6d2 (diff) | |
parent | ad116e26d102651ab6dc2752ae21afb92b72ad6f (diff) | |
download | cryptography-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.rst | 4 | ||||
-rw-r--r-- | docs/hazmat/primitives/mac/hmac.rst | 4 |
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): ... |