summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2025-02-19 10:23:28 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-03-02 15:19:43 +0800
commitcb25dbb60542c56a68089b57f9edd994a6b5bbf4 (patch)
tree3bdcd88a27b94c0e8f5a1156891d9626be291dcf
parent84b1576355c41a935102da5d62bb28e74be3db45 (diff)
crypto: skcipher - use scatterwalk_start_at_pos()
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@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/skcipher.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index cdf0f11c7eaa..59e33f63f845 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -363,14 +363,8 @@ static int skcipher_walk_aead_common(struct skcipher_walk *walk,
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