mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
crypto: adiantum - Use memcpy_{to,from}_sglist()
Call the newer, easier-to-read functions memcpy_to_sglist() and memcpy_from_sglist() directly instead of calling scatterwalk_map_and_copy(). No change in behavior. Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Link: https://lore.kernel.org/r/20251211011846.8179-9-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
This commit is contained in:
parent
cd912b3452
commit
73c203fe55
1 changed files with 4 additions and 4 deletions
|
|
@ -427,8 +427,8 @@ static int adiantum_finish(struct skcipher_request *req)
|
|||
/* Slow path that works for any destination scatterlist */
|
||||
adiantum_hash_message(req, dst, &digest);
|
||||
le128_sub(&rctx->rbuf.bignum, &rctx->rbuf.bignum, &digest);
|
||||
scatterwalk_map_and_copy(&rctx->rbuf.bignum, dst,
|
||||
bulk_len, sizeof(le128), 1);
|
||||
memcpy_to_sglist(dst, bulk_len, &rctx->rbuf.bignum,
|
||||
sizeof(le128));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -477,8 +477,8 @@ static int adiantum_crypt(struct skcipher_request *req, bool enc)
|
|||
} else {
|
||||
/* Slow path that works for any source scatterlist */
|
||||
adiantum_hash_message(req, src, &digest);
|
||||
scatterwalk_map_and_copy(&rctx->rbuf.bignum, src,
|
||||
bulk_len, sizeof(le128), 0);
|
||||
memcpy_from_sglist(&rctx->rbuf.bignum, src, bulk_len,
|
||||
sizeof(le128));
|
||||
}
|
||||
le128_add(&rctx->rbuf.bignum, &rctx->rbuf.bignum, &rctx->header_hash);
|
||||
le128_add(&rctx->rbuf.bignum, &rctx->rbuf.bignum, &digest);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue