diff options
author | Eric Biggers <ebiggers@google.com> | 2023-10-18 22:53:33 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-10-27 18:04:24 +0800 |
commit | f9dc9f2e4072de356614d95940c9d7f448a4e334 (patch) | |
tree | d3101a57b81a1356a7126c08c84889ef65399547 /certs | |
parent | 21415bfe8b5543c41b64b19674e5fcc2c942623e (diff) | |
download | linux-f9dc9f2e4072de356614d95940c9d7f448a4e334.tar.gz linux-f9dc9f2e4072de356614d95940c9d7f448a4e334.tar.bz2 linux-f9dc9f2e4072de356614d95940c9d7f448a4e334.zip |
crypto: cmac - remove unnecessary alignment logic
The cmac template is setting its alignmask to that of its underlying
'cipher'. Yet, it doesn't care itself about how its inputs and outputs
are aligned, which is ostensibly the point of the alignmask. Instead,
cmac actually just uses its alignmask itself to runtime-align certain
fields in its tfm and desc contexts appropriately for its underlying
cipher. That is almost entirely pointless too, though, since cmac 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, this patch removes the manual alignment code from cmac and
makes it stop setting an alignmask.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'certs')
0 files changed, 0 insertions, 0 deletions