mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-25 19:42:19 +00:00
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>
This commit is contained in:
@@ -71,10 +71,10 @@ static void crypto_aegis128_aesni_process_ad(
|
||||
|
||||
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 >= AEGIS128_BLOCK_SIZE) {
|
||||
if (pos > 0) {
|
||||
@@ -97,9 +97,7 @@ static void crypto_aegis128_aesni_process_ad(
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user