We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43a466d commit ee91c67Copy full SHA for ee91c67
lib/Crypto/Hash/CMAC.py
@@ -242,11 +242,15 @@ def verify(self, mac_tag):
242
raise ValueError("MAC check failed")
243
244
def hexverify(self, hex_mac_tag):
245
- """Return the **printable** MAC tag of the message authenticated so far.
+ """Verify that a given **printable** MAC (computed by another party)
246
+ is valid.
247
- :return: The MAC tag, computed over the data processed so far.
248
- Hexadecimal encoded.
249
- :rtype: string
+ Args:
+ 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.
254
"""
255
256
self.verify(unhexlify(tobytes(hex_mac_tag)))
0 commit comments