linux/net/mac80211/aes_cmac.h
Eric Biggers c9de7246d5 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>
2026-03-09 13:27:21 -07:00

16 lines
335 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright 2008, Jouni Malinen <j@w1.fi>
*/
#ifndef AES_CMAC_H
#define AES_CMAC_H
#include <crypto/aes-cbc-macs.h>
void ieee80211_aes_cmac(const struct aes_cmac_key *key, const u8 *aad,
const u8 *data, size_t data_len, u8 *mic,
unsigned int mic_len);
#endif /* AES_CMAC_H */