From 9c11549e2ce9ada9b37bf4a94f69c963366c3133 Mon Sep 17 00:00:00 2001 From: Gonzalo Atienza <38573982+gonatienza@users.noreply.github.com> Date: Sun, 22 Sep 2024 21:23:47 -0400 Subject: [PATCH] mac-docs-updates (#11644) --- docs/hazmat/primitives/mac/cmac.rst | 1 + docs/hazmat/primitives/mac/poly1305.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/hazmat/primitives/mac/cmac.rst b/docs/hazmat/primitives/mac/cmac.rst index c7eabd9d953f..f5e8b59c0f4d 100644 --- a/docs/hazmat/primitives/mac/cmac.rst +++ b/docs/hazmat/primitives/mac/cmac.rst @@ -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() diff --git a/docs/hazmat/primitives/mac/poly1305.rst b/docs/hazmat/primitives/mac/poly1305.rst index e3240f5baccf..cc7f9e2b7a58 100644 --- a/docs/hazmat/primitives/mac/poly1305.rst +++ b/docs/hazmat/primitives/mac/poly1305.rst @@ -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()