ltq-deu: add shash cbcmac-aes algorithm to the driver
authorDaniel Kestrel <kestrel1974@t-online.de>
Thu, 8 Jul 2021 05:59:41 +0000 (07:59 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 5 Jan 2022 23:23:15 +0000 (00:23 +0100)
commit79efaa7f8fa5c4e2010c9948155838cfb5e72663
treec1b1fbacd4a8c38a483ff5e934c1cc740c3de2d5
parentf8e5c6080c2eb7397b03a4e6f64d3f6ea01b05d1
ltq-deu: add shash cbcmac-aes algorithm to the driver

Since commit 53b6783 hostapd is using the kernel api which includes the
cbcmac-aes shash algorithm. The kernels implementation is a wrapper around
the aes encryption algorithm, which encrypts block (16 bytes) by block.
When the ltq-deu driver is present, it uses hardware aes, but every 16 byte
encrypt requires setting the key. This is very inefficient and is a huge
overhead. Since the cbcmac-aes is simply a hash that uses the cbc aes
algorithm starting with an iv set to x'00' with an optional ecb aes
encryption of a possible last incomplete block that is padded with the
positional bytes of the last cbc encrypted block, this algorithm is now
added to the driver. Most of the code is derived from md5-hmac and
tailored for aes. Tested with the kernels crypto testmgr including extra
tests against the kernels generic ccm module implementation.
This patch also fixes the overallocation in the aes_ctx that is caused
by using u32 instead of u8 for the aes keys.

Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c