]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: lib/chachapoly - Drop dependency on CRYPTO_ALGAPI
authorArd Biesheuvel <ardb@kernel.org>
Fri, 28 Feb 2025 12:11:38 +0000 (13:11 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 8 Mar 2025 08:24:36 +0000 (16:24 +0800)
commitba89b4eaa6cf9bb9bdacf0ee80567b8e9d986279
treebf0ee5aeb67a77ae4ac42c6f0d3bebea1583ece6
parent06f0e09f6e5451aecbbac60e26eecd79ddb82f55
crypto: lib/chachapoly - Drop dependency on CRYPTO_ALGAPI

The ChaCha20-Poly1305 library code uses the sg_miter API to process
input presented via scatterlists, except for the special case where the
digest buffer is not covered entirely by the same scatterlist entry as
the last byte of input. In that case, it uses scatterwalk_map_and_copy()
to access the memory in the input scatterlist where the digest is stored.

This results in a dependency on crypto/scatterwalk.c and therefore on
CONFIG_CRYPTO_ALGAPI, which is unnecessary, as the sg_miter API already
provides this functionality via sg_copy_to_buffer(). So use that
instead, and drop the dependencies on CONFIG_CRYPTO_ALGAPI and
CONFIG_CRYPTO.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
lib/crypto/Kconfig
lib/crypto/chacha20poly1305.c