Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac-docs-updates #11644

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/hazmat/primitives/mac/cmac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ A subset of CMAC with the AES-128 algorithm is described in :rfc:`4493`.

>>> from cryptography.hazmat.primitives import cmac
>>> from cryptography.hazmat.primitives.ciphers import algorithms
>>> key = b"\x00" * 16 # A real key should come from os.urandom(16)
>>> c = cmac.CMAC(algorithms.AES(key))
>>> c.update(b"message to authenticate")
>>> c.finalize()
Expand Down
1 change: 1 addition & 0 deletions docs/hazmat/primitives/mac/poly1305.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ messages allows an attacker to forge tags. Poly1305 is described in
.. doctest::

>>> from cryptography.hazmat.primitives import poly1305
>>> key = b"\x01" * 32 # A real key should come from os.urandom(32)
>>> p = poly1305.Poly1305(key)
>>> p.update(b"message to authenticate")
>>> p.finalize()
Expand Down