Skip to main content

Module mac

Module mac 

Source
Expand description

CBC-MAC with rolling ICV and the S-MAC1/S-MAC2 swap on the final block.

§Spec: Annex D.5

tmp = ICV
for each 16-byte block of padded input except the last:
    tmp = AES_S-MAC1(tmp XOR block)
tmp = AES_S-MAC2(tmp XOR last_block)
MAC = tmp        // first 4 bytes are sent on the wire

Functions§

cbc_mac
Compute the OSDP CBC-MAC.