Skip to content

Commit ee91c67

Browse files
EmojigitLegrandin
authored andcommitted
Update CMAC.py
1 parent 43a466d commit ee91c67

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/Crypto/Hash/CMAC.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,15 @@ def verify(self, mac_tag):
242242
raise ValueError("MAC check failed")
243243

244244
def hexverify(self, hex_mac_tag):
245-
"""Return the **printable** MAC tag of the message authenticated so far.
245+
"""Verify that a given **printable** MAC (computed by another party)
246+
is valid.
246247
247-
:return: The MAC tag, computed over the data processed so far.
248-
Hexadecimal encoded.
249-
:rtype: string
248+
Args:
249+
hex_mac_tag (string): the expected MAC of the message, as a hexadecimal string.
250+
251+
Raises:
252+
ValueError: if the MAC does not match. It means that the message
253+
has been tampered with or that the MAC key is incorrect.
250254
"""
251255

252256
self.verify(unhexlify(tobytes(hex_mac_tag)))

0 commit comments

Comments
 (0)