mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
crypto: aegis - use the new scatterwalk functions
Use scatterwalk_next() which consolidates scatterwalk_clamp() and scatterwalk_map(), and 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>
This commit is contained in:
parent
cb25dbb605
commit
c89edd931a
|
|
@ -284,10 +284,10 @@ static void crypto_aegis128_process_ad(struct aegis_state *state,
|
|||
|
||||
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 >= AEGIS_BLOCK_SIZE) {
|
||||
if (pos > 0) {
|
||||
|
|
@ -308,9 +308,7 @@ static void crypto_aegis128_process_ad(struct aegis_state *state,
|
|||
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user