]> git.ipfire.org Git - thirdparty/linux.git/commit
wifi: mac80211: Use AES-CMAC library in ieee80211_aes_cmac()
authorEric Biggers <ebiggers@kernel.org>
Wed, 18 Feb 2026 21:35:00 +0000 (13:35 -0800)
committerEric Biggers <ebiggers@kernel.org>
Mon, 9 Mar 2026 20:27:21 +0000 (13:27 -0700)
commitc9de7246d5422bbea5374a402e761cf7725a263e
tree319ff3906ced715828a87e690360633172569954
parent2505f9157ebf2bbdb7b1c0ff1cb7274e651ab028
wifi: mac80211: Use AES-CMAC library in ieee80211_aes_cmac()

Now that AES-CMAC has a library API, convert the mac80211 AES-CMAC
packet authentication code to use it instead of a "cmac(aes)"
crypto_shash.  This has multiple benefits, such as:

- It's faster.  The AES-CMAC code is now called directly, without
  unnecessary overhead such as indirect calls.

- MAC calculation can no longer fail.

- The AES-CMAC key struct is now a fixed size, allowing it to be
  embedded directly into 'struct ieee80211_key' rather than using a
  separate allocation.  Note that although this increases the size of
  the 'u.cmac' field of 'struct ieee80211_key', it doesn't cause it to
  exceed the size of the largest variant of the union 'u'.  Therefore,
  the size of 'struct ieee80211_key' itself is unchanged.

Acked-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20260218213501.136844-15-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
net/mac80211/Kconfig
net/mac80211/aes_cmac.c
net/mac80211/aes_cmac.h
net/mac80211/key.c
net/mac80211/key.h
net/mac80211/wpa.c