Skip to content

crypto::cmac

AES-CMAC, from RFC 4493 (a.k.a. OMAC1).

The message integrity check on WPA2 EAPOL-Key frames that use the AES-128-CMAC AKM, and omac1_aes_128 in the adapter’s crypto table. It is a CBC-MAC with a pair of derived subkeys that remove the length-extension weakness plain CBC-MAC has — the subkey applied to the final block differs depending on whether that block was full or padded, so two messages where one is a prefix of the other cannot share a tag.

Built entirely on [Aes128]; no new field arithmetic beyond the subkey doubling, which is a single multiply by x in GF(2^128).

fn aes_cmac(key: &[u8; 16], msg: &[u8]) -> [u8; 16]

AES-128-CMAC of msg under key. Sixteen-byte tag.