linux-stable/include/crypto/internal
Eric Biggers c626910f3f crypto: ahash - remove support for nonzero alignmask
Currently, the ahash API checks the alignment of all key and result
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.  First, since it does not apply to
the message, its effect is much more limited than e.g. is the case for
the alignmask for "skcipher".  Second, the key and result buffers are
given as virtual addresses and cannot (in general) be DMA'ed into, so
drivers end up having to copy to/from them in software anyway.  As a
result it's easy to use memcpy() or the unaligned access helpers.

The crypto_hash_walk_*() helper functions do use the alignmask to align
the message.  But with one exception those are only used for shash
algorithms being exposed via the ahash API, not for native ahashes, and
aligning the message is not required in this case, especially now that
alignmask support has been removed from shash.  The exception is the
n2_core driver, which doesn't set an alignmask.

In any case, no ahash algorithms actually set a nonzero alignmask
anymore.  Therefore, remove support for it from ahash.  The benefit is
that all the code to handle "misaligned" buffers in the ahash API goes
away, reducing the overhead of the ahash API.

This follows the same change that was made to shash.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2023-10-27 18:04:29 +08:00
..
acompress.h crypto: acomp - Count error stats differently 2023-03-14 17:06:42 +08:00
aead.h crypto: aead - Use crypto_request_complete 2023-02-13 18:34:48 +08:00
akcipher.h crypto: akcipher - Use crypto_request_complete 2023-02-13 18:34:48 +08:00
blake2b.h crypto: blake2b - sync with blake2s implementation 2021-01-03 08:41:39 +11:00
blake2s.h crypto: blake2s - remove shash module 2022-06-10 16:43:49 +08:00
chacha.h crypto: chacha - fix warning message in header file 2019-12-11 16:48:38 +08:00
cipher.h crypto: cipher - Add crypto_clone_cipher 2023-05-24 18:12:33 +08:00
cryptouser.h crypto: user - fix potential warnings in cryptouser.h 2019-08-02 14:44:31 +10:00
des.h crypto: remove CRYPTO_TFM_RES_WEAK_KEY 2020-01-09 11:30:53 +08:00
ecc.h crypto: ecc - Export additional helper functions 2021-10-29 21:04:03 +08:00
engine.h crypto: engine - Move struct crypto_engine into internal/engine.h 2023-08-18 17:01:10 +08:00
geniv.h crypto: geniv - remove unneeded arguments from aead_geniv_alloc() 2020-07-16 21:49:07 +10:00
hash.h crypto: ahash - remove support for nonzero alignmask 2023-10-27 18:04:29 +08:00
kdf_selftest.h crypto: kdf - Add key derivation self-test support code 2021-11-26 16:25:17 +11:00
kpp.h crypto: kpp - Use crypto_request_complete 2023-02-13 18:34:48 +08:00
poly1305.h crypto: poly1305 - fix poly1305_core_setkey() declaration 2021-04-02 18:28:12 +11:00
rng.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
rsa.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
scompress.h crypto: acomp - Count error stats differently 2023-03-14 17:06:42 +08:00
sig.h crypto: sig - Add interface for sign/verify 2023-06-23 16:15:36 +08:00
simd.h crypto: simd,testmgr - introduce crypto_simd_usable() 2019-03-22 20:57:27 +08:00
skcipher.h crypto: skcipher - Remove obsolete skcipher_alg helpers 2023-10-13 18:27:27 +08:00