netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] mac80211: use crypto shash for AES cmac
@ 2017-02-06 10:49 Ard Biesheuvel
  2017-02-06 10:49 ` [PATCH v3 1/2] mac80211: fils_aead: Use crypto api CMAC shash rather than bare cipher Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ard Biesheuvel @ 2017-02-06 10:49 UTC (permalink / raw)
  To: johannes-cdvu00un1VgdHxzADdlk8Q,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, netdev-u79uwXL29TY76Z2rM5mHXA,
	jouni-A+ZNKFmMK5xy9aJCnZT0Uw, Ard Biesheuvel

This is something I spotted while working on AES in various modes for
ARM and arm64.

The mac80211 aes_cmac code reimplements the CMAC algorithm based on the
core AES cipher, which is rather restrictive in how platforms can satisfy
the dependency on this algorithm. For instance, SIMD implementations may
have a considerable setup time, which cannot be amortized over the entire
input when calling into the crypto API one block at a time. Also, it prevents
the use of more secure fixed time implementations, since not all AES drivers
expose the cipher interface.

So switch aes_cmac to use a cmac(aes) shash. Before updating the aes_cmac code
in patch #2, the FILS AEAD code is moved to using a cmac(aes) shash supplied by
the crypto API so that we can remove the open coded version entirely in the
second patch.

v3: - use more idiomatic SHASH_DESC_ON_STACK to allocate the shash descriptors
    - replace compound literal zero vectors with explicitly defined ones
    - drop a redundant memcpy() in #2

Ard Biesheuvel (2):
  mac80211: fils_aead: Use crypto api CMAC shash rather than bare cipher
  mac80211: aes-cmac: switch to shash CMAC driver

 net/mac80211/Kconfig     |   1 +
 net/mac80211/aes_cmac.c  | 126 ++++----------------
 net/mac80211/aes_cmac.h  |  15 +--
 net/mac80211/fils_aead.c |  74 +++++-------
 net/mac80211/key.h       |   2 +-
 5 files changed, 66 insertions(+), 152 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-02-08  8:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-06 10:49 [PATCH v3 0/2] mac80211: use crypto shash for AES cmac Ard Biesheuvel
2017-02-06 10:49 ` [PATCH v3 1/2] mac80211: fils_aead: Use crypto api CMAC shash rather than bare cipher Ard Biesheuvel
     [not found]   ` <1486378168-31028-2-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-08  7:00     ` Johannes Berg
     [not found]       ` <1486537227.4603.2.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-02-08  7:45         ` Ard Biesheuvel
2017-02-08  7:46           ` Johannes Berg
2017-02-06 10:49 ` [PATCH v3 2/2] mac80211: aes-cmac: switch to shash CMAC driver Ard Biesheuvel
     [not found] ` <1486378168-31028-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-08  8:19   ` [PATCH v3 0/2] mac80211: use crypto shash for AES cmac Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).