Lines Matching refs:cmac
18 from cryptography.hazmat.primitives.cmac import CMAC
55 cmac = CMAC(AES(binascii.unhexlify(key)), backend)
56 cmac.update(binascii.unhexlify(message))
57 assert binascii.hexlify(cmac.finalize()) == output
70 cmac = CMAC(AES(binascii.unhexlify(key)), backend)
71 cmac.update(binascii.unhexlify(message))
72 assert cmac.verify(binascii.unhexlify(output)) is None
90 cmac = CMAC(TripleDES(binascii.unhexlify(key)), backend)
91 cmac.update(binascii.unhexlify(message))
92 assert binascii.hexlify(cmac.finalize()) == output
110 cmac = CMAC(TripleDES(binascii.unhexlify(key)), backend)
111 cmac.update(binascii.unhexlify(message))
112 assert cmac.verify(binascii.unhexlify(output)) is None
121 cmac = CMAC(AES(key), backend)
122 cmac.update(b"6bc1bee22e409f96e93d7e117393172a")
125 cmac.verify(b"foobar")
144 cmac = CMAC(AES(key), backend)
145 cmac.finalize()
148 cmac.update(b"foo")
151 cmac.copy()
154 cmac.finalize()
157 cmac.verify(b"")
166 cmac = CMAC(AES(key), backend)
169 cmac.update(u'')
172 cmac.verify(u'')
181 cmac = CMAC(AES(key), backend)
182 cmac.update(b"6bc1bee22e409f96e93d7e117393172a")
183 copy_cmac = cmac.copy()
184 assert cmac.finalize() == copy_cmac.finalize()
193 cmac = CMAC(AES(key), backend)
194 cmac.update(b"6bc1bee22e409f96e93d7e117393172a")
195 assert cmac.finalize() == binascii.unhexlify(