aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2025-02-19 10:23:37 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-03-02 15:19:44 +0800
commitfd7cbef67f975c22de471117b3f52ddcd2cf140c (patch)
tree08767dc18c982027c38e7aa40101da406fba1b77
parentcrypto: x86/aes-gcm - use the new scatterwalk functions (diff)
downloadlinux-fd7cbef67f975c22de471117b3f52ddcd2cf140c.tar.gz
linux-fd7cbef67f975c22de471117b3f52ddcd2cf140c.zip
crypto: x86/aegis - use the new scatterwalk functions
In crypto_aegis128_aesni_process_ad(), use scatterwalk_next() which consolidates scatterwalk_clamp() and scatterwalk_map(). Use scatterwalk_done_src() which consolidates scatterwalk_unmap(), scatterwalk_advance(), and scatterwalk_done(). Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--arch/x86/crypto/aegis128-aesni-glue.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/x86/crypto/aegis128-aesni-glue.c b/arch/x86/crypto/aegis128-aesni-glue.c
index 01fa568dc5fc..1bd093d073ed 100644
--- a/arch/x86/crypto/aegis128-aesni-glue.c
+++ b/arch/x86/crypto/aegis128-aesni-glue.c
@@ -71,10 +71,10 @@ static void crypto_aegis128_aesni_process_ad(
scatterwalk_start(&walk, sg_src);
while (assoclen != 0) {
- unsigned int size = scatterwalk_clamp(&walk, assoclen);
+ unsigned int size;
+ const u8 *mapped = scatterwalk_next(&walk, assoclen, &size);
unsigned int left = size;
- void *mapped = scatterwalk_map(&walk);
- const u8 *src = (const u8 *)mapped;
+ const u8 *src = mapped;
if (pos + size >= AEGIS128_BLOCK_SIZE) {
if (pos > 0) {
@@ -97,9 +97,7 @@ static void crypto_aegis128_aesni_process_ad(
pos += left;
assoclen -= size;
- scatterwalk_unmap(mapped);
- scatterwalk_advance(&walk, size);
- scatterwalk_done(&walk, 0, assoclen);
+ scatterwalk_done_src(&walk, mapped, size);
}
if (pos > 0) {