Re: [PATCH v2 1/2] mac80211: fils_aead: Use crypto api CMAC shash rather than bare cipher

2017-02-06 Thread Ard Biesheuvel
On 6 February 2017 at 08:47, Johannes Berg wrote: > >> { >> u8 d[AES_BLOCK_SIZE], tmp[AES_BLOCK_SIZE]; >> + struct shash_desc *desc; >> + u8 buf[sizeof(*desc) + crypto_shash_descsize(tfm)] >> CRYPTO_MINALIGN_ATTR; I realised we have a more idiomatic

Re: [PATCH v2 1/2] mac80211: fils_aead: Use crypto api CMAC shash rather than bare cipher

2017-02-06 Thread Johannes Berg
>  { >   u8 d[AES_BLOCK_SIZE], tmp[AES_BLOCK_SIZE]; > + struct shash_desc *desc; > + u8 buf[sizeof(*desc) + crypto_shash_descsize(tfm)] > CRYPTO_MINALIGN_ATTR; >   size_t i; > - const u8 *data[2]; > - size_t data_len[2], data_elems; > + > + desc = (struct shash_desc

[PATCH v2 1/2] mac80211: fils_aead: Use crypto api CMAC shash rather than bare cipher

2017-02-05 Thread Ard Biesheuvel
Switch the FILS AEAD code to use a cmac(aes) shash instantiated by the crypto API rather than reusing the open coded implementation in aes_cmac_vector(). This makes the code more understandable, and allows platforms to implement cmac(aes) in a more secure (*) and efficient way than is typically