linux/Documentation/crypto
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
..
api-aead.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-akcipher.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-digest.rst crypto: doc - Fix hash export state information 2017-02-03 18:16:11 +08:00
api-intro.rst It's been a busy cycle for documentation - hopefully the busiest for a 2020-08-04 22:47:54 -07:00
api-kpp.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-rng.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-samples.rst crypto: doc - improve the skcipher API example code 2019-06-13 14:31:40 +08:00
api-skcipher.rst crypto: remove cipher routines from public crypto API 2021-01-03 08:41:35 +11:00
api.rst crypto: skcipher - remove remnants of internal IV generators 2018-12-23 11:52:45 +08:00
architecture.rst crypto: ablkcipher - remove deprecated and unused ablkcipher support 2019-11-17 09:02:49 +08:00
asymmetric-keys.rst docs: crypto: convert asymmetric-keys.txt to ReST 2020-06-19 14:03:46 -06:00
async-tx-api.rst docs: crypto: async-tx-api: fix typo in struct name 2023-06-09 01:59:30 -06:00
crypto_engine.rst crypto: engine - Add KPP Support to Crypto Engine 2021-10-29 21:04:03 +08:00
descore-readme.rst docs: crypto: descore-readme.txt: convert to ReST format 2020-06-19 14:05:22 -06:00
devel-algos.rst crypto: ahash - remove support for nonzero alignmask 2023-10-27 18:04:29 +08:00
index.rst Docs/subsystem-apis: Remove '[The ]Linux' prefixes from titles of listed documents 2023-01-24 15:27:08 -07:00
intro.rst crypto: doc - convert crypto API documentation to Sphinx 2016-12-13 16:37:54 -07:00
userspace-if.rst crypto: af_alg - Support symmetric encryption via keyring keys 2022-10-28 12:36:34 +08:00