def __init__(self, key, key_handle, nonce, data_len):
flags = (((pyhsm.defines.YSM_AEAD_MAC_SIZE - <NUM_LIT:2>) / <NUM_LIT:2>) << <NUM_LIT:3>) | (pyhsm.defines.YSM_CCM_CTR_SIZE - <NUM_LIT:1>)<EOL>t = _ctr_counter(key_handle, nonce, flags = flags, value = data_len)<EOL>t_mac = t.pack()<EOL>self.mac_aes = AES.new(key, AES.MODE_ECB)<EOL>self.mac = self.mac_aes.encrypt(t_mac)<EOL>
Initialize CBC-MAC like the YubiHSM does.