I'm trying to generate AES-CMAC using cryptography library. And with message and key it is generating different output then online calculator : AES-CMAC ONLINE CALCULATOR
Here is my code
aeskey_for_CMAC = binascii.hexlify(key[-16:])
c = cmac.CMAC(algorithms.AES(aeskey_for_CMAC))
c.update(message)
Cmac = c.finalize()
print("CMAC : ",binascii.hexlify( Cmac))
Here the key = b'cce9cdc049d9b46140a850dc8c7b146c9efa60caa228c49e1eec9303bed205ba' and message = b'6ffad88b23783dc86974c75f87370dc0'
Output from above code : b'dc629809794c584107f4d81cb7133982'
Output from online calculator/Expected : dfea87c2 b4c2678a b63241e5 52b84acd
Can anybody tell me whats wrong in my code?