Skip to content

Commit

Permalink
mac80211: simplify buffers in aes_128_cmac_vector
Browse files Browse the repository at this point in the history
There's no need to use a single scratch buffer and
calculate offsets into it, just use two separate
buffers for the separate variables.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Aug 20, 2012
1 parent 8b3d1cc commit d348f69
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions net/mac80211/aes_cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,10 @@ static void gf_mulx(u8 *pad)
static void aes_128_cmac_vector(struct crypto_cipher *tfm, size_t num_elem,
const u8 *addr[], const size_t *len, u8 *mac)
{
u8 scratch[2 * AES_BLOCK_SIZE];
u8 *cbc, *pad;
u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE];
const u8 *pos, *end;
size_t i, e, left, total_len;

cbc = scratch;
pad = scratch + AES_BLOCK_SIZE;

memset(cbc, 0, AES_BLOCK_SIZE);

total_len = 0;
Expand Down

0 comments on commit d348f69

Please sign in to comment.