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

Fix documentation of Crypto.Hash.CMAC.CMAC.hexverify #776

Merged
merged 1 commit into from
Dec 12, 2023
Merged
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
12 changes: 8 additions & 4 deletions lib/Crypto/Hash/CMAC.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,15 @@ def verify(self, mac_tag):
raise ValueError("MAC check failed")

def hexverify(self, hex_mac_tag):
"""Return the **printable** MAC tag of the message authenticated so far.
"""Verify that a given **printable** MAC (computed by another party)
is valid.

:return: The MAC tag, computed over the data processed so far.
Hexadecimal encoded.
:rtype: string
Args:
hex_mac_tag (string): the expected MAC of the message, as a hexadecimal string.

Raises:
ValueError: if the MAC does not match. It means that the message
has been tampered with or that the MAC key is incorrect.
"""

self.verify(unhexlify(tobytes(hex_mac_tag)))
Expand Down
Loading