[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250219182341.43961-7-ebiggers@kernel.org>
Date: Wed, 19 Feb 2025 10:23:28 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: linux-crypto@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: [PATCH v3 06/19] crypto: skcipher - use scatterwalk_start_at_pos()
From: Eric Biggers <ebiggers@...gle.com>
In skcipher_walk_aead_common(), use scatterwalk_start_at_pos() instead
of a sequence of scatterwalk_start(), scatterwalk_copychunks(..., 2),
and scatterwalk_done(). This is simpler and faster.
Signed-off-by: Eric Biggers <ebiggers@...gle.com>
---
crypto/skcipher.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index e3751cc88b76e..33508d001f361 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -361,18 +361,12 @@ static int skcipher_walk_aead_common(struct skcipher_walk *walk,
walk->flags = 0;
if (unlikely(!walk->total))
return 0;
- scatterwalk_start(&walk->in, req->src);
- scatterwalk_start(&walk->out, req->dst);
-
- scatterwalk_copychunks(NULL, &walk->in, req->assoclen, 2);
- scatterwalk_copychunks(NULL, &walk->out, req->assoclen, 2);
-
- scatterwalk_done(&walk->in, 0, walk->total);
- scatterwalk_done(&walk->out, 0, walk->total);
+ scatterwalk_start_at_pos(&walk->in, req->src, req->assoclen);
+ scatterwalk_start_at_pos(&walk->out, req->dst, req->assoclen);
/*
* Accessing 'alg' directly generates better code than using the
* crypto_aead_blocksize() and similar helper functions here, as it
* prevents the algorithm pointer from being repeatedly reloaded.
--
2.48.1
Powered by blists - more mailing lists