diff options
author | Eric Biggers <ebiggers@google.com> | 2023-10-19 08:53:37 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-10-27 13:04:25 +0300 |
commit | 345bfa3c10ced43281877ce68ae7b3bf360afc76 (patch) | |
tree | 3a38f2df549420fbf5e570b01e85b4feb26061ce /drivers/nfc | |
parent | a2b1118052c41ca92cbc2366e77b2f0ff3b054ba (diff) | |
download | linux-345bfa3c10ced43281877ce68ae7b3bf360afc76.tar.xz |
crypto: shash - remove support for nonzero alignmask
Currently, the shash API checks the alignment of all message, key, and
digest buffers against the algorithm's declared alignmask, and for any
unaligned buffers it falls back to manually aligned temporary buffers.
This is virtually useless, however. In the case of the message buffer,
cryptographic hash functions internally operate on fixed-size blocks, so
implementations end up needing to deal with byte-aligned data anyway
because the length(s) passed to ->update might not be divisible by the
block size. Word-alignment of the message can theoretically be helpful
for CRCs, like what was being done in crc32c-sparc64. But in practice
it's better for the algorithms to use unaligned accesses or align the
message themselves. A similar argument applies to the key and digest.
In any case, no shash algorithms actually set a nonzero alignmask
anymore. Therefore, remove support for it from shash. The benefit is
that all the code to handle "misaligned" buffers in the shash API goes
away, reducing the overhead of the shash API.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/nfc')
0 files changed, 0 insertions, 0 deletions