From: Chien Wong <m@xv97.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH v3 3/5] wifi: mac80211: utilize the newly defined CMAC constants
Date: Tue, 11 Nov 2025 22:57:57 +0800 [thread overview]
Message-ID: <20251111145759.111691-4-m@xv97.com> (raw)
In-Reply-To: <20251111145759.111691-1-m@xv97.com>
Make use of the added constants to reduce duplication.
Signed-off-by: Chien Wong <m@xv97.com>
---
net/mac80211/aes_cmac.c | 4 ++--
net/mac80211/aes_gmac.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/aes_cmac.c b/net/mac80211/aes_cmac.c
index adce68ea0981..01fb8b6c5dfb 100644
--- a/net/mac80211/aes_cmac.c
+++ b/net/mac80211/aes_cmac.c
@@ -16,8 +16,8 @@
#include "key.h"
#include "aes_cmac.h"
-#define CMAC_TLEN 8 /* CMAC TLen = 64 bits (8 octets) */
-#define CMAC_TLEN_256 16 /* CMAC TLen = 128 bits (16 octets) */
+#define CMAC_TLEN IEEE80211_CMAC_128_MIC_LEN
+#define CMAC_TLEN_256 IEEE80211_CMAC_256_MIC_LEN
#define AAD_LEN 20
static const u8 zero[CMAC_TLEN_256];
diff --git a/net/mac80211/aes_gmac.h b/net/mac80211/aes_gmac.h
index c739356bae2a..09378e52c7a6 100644
--- a/net/mac80211/aes_gmac.h
+++ b/net/mac80211/aes_gmac.h
@@ -9,7 +9,7 @@
#include <linux/crypto.h>
#define GMAC_AAD_LEN 20
-#define GMAC_MIC_LEN 16
+#define GMAC_MIC_LEN IEEE80211_GMAC_MIC_LEN
#define GMAC_NONCE_LEN 12
struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[],
--
2.51.2
next prev parent reply other threads:[~2025-11-11 14:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 14:57 [PATCH v3 0/5] wifi: mac80211: refactor CMAC implementation Chien Wong
2025-11-11 14:57 ` [PATCH v3 1/5] wifi: mac80211: fix CMAC functions not handling errors Chien Wong
2025-11-12 13:11 ` Johannes Berg
2025-11-13 13:15 ` Chien Wong
2025-11-11 14:57 ` [PATCH v3 2/5] wifi: mac80211: add generic MMIE struct defines Chien Wong
2025-11-11 14:57 ` Chien Wong [this message]
2025-11-12 13:12 ` [PATCH v3 3/5] wifi: mac80211: utilize the newly defined CMAC constants Johannes Berg
2025-11-13 13:16 ` Chien Wong
2025-11-11 14:57 ` [PATCH v3 4/5] wifi: mac80211: refactor CMAC crypt functions Chien Wong
2025-11-12 13:19 ` Johannes Berg
2025-11-13 13:24 ` Chien Wong
2025-11-11 14:57 ` [PATCH v3 5/5] wifi: mac80211: refactor CMAC packet handlers Chien Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251111145759.111691-4-m@xv97.com \
--to=m@xv97.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox