Skip to content

Commit fd7cbef

Browse files
ebiggersherbertx
authored andcommitted
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>
1 parent e9787de commit fd7cbef

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

arch/x86/crypto/aegis128-aesni-glue.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ static void crypto_aegis128_aesni_process_ad(
7171

7272
scatterwalk_start(&walk, sg_src);
7373
while (assoclen != 0) {
74-
unsigned int size = scatterwalk_clamp(&walk, assoclen);
74+
unsigned int size;
75+
const u8 *mapped = scatterwalk_next(&walk, assoclen, &size);
7576
unsigned int left = size;
76-
void *mapped = scatterwalk_map(&walk);
77-
const u8 *src = (const u8 *)mapped;
77+
const u8 *src = mapped;
7878

7979
if (pos + size >= AEGIS128_BLOCK_SIZE) {
8080
if (pos > 0) {
@@ -97,9 +97,7 @@ static void crypto_aegis128_aesni_process_ad(
9797
pos += left;
9898
assoclen -= size;
9999

100-
scatterwalk_unmap(mapped);
101-
scatterwalk_advance(&walk, size);
102-
scatterwalk_done(&walk, 0, assoclen);
100+
scatterwalk_done_src(&walk, mapped, size);
103101
}
104102

105103
if (pos > 0) {

0 commit comments

Comments
 (0)