diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-02-06 13:49:28 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-02-08 11:19:33 +0300 |
commit | 26717828b75dd5c46e97f7f4a9b937d038bb2852 (patch) | |
tree | cb192493dd8bb60c52260932877cd7e23de96a81 /net/mac80211/aes_cmac.h | |
parent | fe8de3da13bdbcbe8b583a3bbadf677da0f04f83 (diff) | |
download | linux-26717828b75dd5c46e97f7f4a9b937d038bb2852.tar.xz |
mac80211: aes-cmac: switch to shash CMAC driver
Instead of open coding the CMAC algorithm in the mac80211 driver using
byte wide xors and calls into the crypto layer for each block of data,
instantiate a cmac(aes) synchronous hash and pass all the data into it
directly. This does not only simplify the code, it also allows the use
of more efficient and more secure implementations, especially on
platforms where SIMD ciphers have a considerable setup cost.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/aes_cmac.h')
-rw-r--r-- | net/mac80211/aes_cmac.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/mac80211/aes_cmac.h b/net/mac80211/aes_cmac.h index 3702041f44fd..fef531f42003 100644 --- a/net/mac80211/aes_cmac.h +++ b/net/mac80211/aes_cmac.h @@ -10,13 +10,14 @@ #define AES_CMAC_H #include <linux/crypto.h> +#include <crypto/hash.h> -struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[], - size_t key_len); -void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, +struct crypto_shash *ieee80211_aes_cmac_key_setup(const u8 key[], + size_t key_len); +void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, const u8 *data, size_t data_len, u8 *mic); -void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, +void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, const u8 *data, size_t data_len, u8 *mic); -void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm); +void ieee80211_aes_cmac_key_free(struct crypto_shash *tfm); #endif /* AES_CMAC_H */ |