Release 4.11 net/mac80211/aes_cmac.c
/*
* AES-128-CMAC with TLen 16 for IEEE 802.11w BIP
* Copyright 2008, Jouni Malinen <j@w1.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/crypto.h>
#include <linux/export.h>
#include <linux/err.h>
#include <crypto/aes.h>
#include <net/mac80211.h>
#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 AAD_LEN 20
static const u8 zero[CMAC_TLEN_256];
void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad,
const u8 *data, size_t data_len, u8 *mic)
{
SHASH_DESC_ON_STACK(desc, tfm);
u8 out[AES_BLOCK_SIZE];
desc->tfm = tfm;
crypto_shash_init(desc);
crypto_shash_update(desc, aad, AAD_LEN);
crypto_shash_update(desc, data, data_len - CMAC_TLEN);
crypto_shash_finup(desc, zero, CMAC_TLEN, out);
memcpy(mic, out, CMAC_TLEN);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jouni Malinen | 51 | 56.04% | 2 | 66.67% |
Ard Biesheuvel | 40 | 43.96% | 1 | 33.33% |
Total | 91 | 100.00% | 3 | 100.00% |
void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad,
const u8 *data, size_t data_len, u8 *mic)
{
SHASH_DESC_ON_STACK(desc, tfm);
desc->tfm = tfm;
crypto_shash_init(desc);
crypto_shash_update(desc, aad, AAD_LEN);
crypto_shash_update(desc, data, data_len - CMAC_TLEN_256);
crypto_shash_finup(desc, zero, CMAC_TLEN_256, mic);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jouni Malinen | 51 | 67.11% | 2 | 66.67% |
Ard Biesheuvel | 25 | 32.89% | 1 | 33.33% |
Total | 76 | 100.00% | 3 | 100.00% |
struct crypto_shash *ieee80211_aes_cmac_key_setup(const u8 key[],
size_t key_len)
{
struct crypto_shash *tfm;
tfm = crypto_alloc_shash("cmac(aes)", 0, 0);
if (!IS_ERR(tfm))
crypto_shash_setkey(tfm, key, key_len);
return tfm;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jouni Malinen | 44 | 86.27% | 2 | 50.00% |
Ard Biesheuvel | 6 | 11.76% | 1 | 25.00% |
Ben Hutchings | 1 | 1.96% | 1 | 25.00% |
Total | 51 | 100.00% | 4 | 100.00% |
void ieee80211_aes_cmac_key_free(struct crypto_shash *tfm)
{
crypto_free_shash(tfm);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jouni Malinen | 13 | 86.67% | 1 | 50.00% |
Ard Biesheuvel | 2 | 13.33% | 1 | 50.00% |
Total | 15 | 100.00% | 2 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jouni Malinen | 198 | 69.96% | 2 | 33.33% |
Ard Biesheuvel | 78 | 27.56% | 1 | 16.67% |
Emmanuel Grumbach | 3 | 1.06% | 1 | 16.67% |
Johannes Berg | 3 | 1.06% | 1 | 16.67% |
Ben Hutchings | 1 | 0.35% | 1 | 16.67% |
Total | 283 | 100.00% | 6 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.