crypto: cbcmac - remove unnecessary alignment logic
authorEric Biggers <ebiggers@google.com>
Thu, 19 Oct 2023 05:53:32 +0000 (22:53 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 27 Oct 2023 10:04:24 +0000 (18:04 +0800)
commit21415bfe8b5543c41b64b19674e5fcc2c942623e
treeb4822090e074284ed213044701a353ced104f772
parentd72c46f7985a22ceb39a69a3bfe05606ec891504
crypto: cbcmac - remove unnecessary alignment logic

The cbcmac template is aligning a field in its desc context to the
alignmask of its underlying 'cipher', at runtime.  This is almost
entirely pointless, since cbcmac is already using the cipher API
functions that handle alignment themselves, and few ciphers set a
nonzero alignmask anyway.  Also, even without runtime alignment, an
alignment of at least 4 bytes can be guaranteed.

Thus, at best this code is optimizing for the rare case of ciphers that
set an alignmask >= 7, at the cost of hurting the common cases.

Therefore, remove the manual alignment code from cbcmac.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ccm.c