Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Biggers and committed by
Herbert Xu
fd7cbef6 e9787def

+4 -6
+4 -6
arch/x86/crypto/aegis128-aesni-glue.c
··· 71 71 72 72 scatterwalk_start(&walk, sg_src); 73 73 while (assoclen != 0) { 74 - unsigned int size = scatterwalk_clamp(&walk, assoclen); 74 + unsigned int size; 75 + const u8 *mapped = scatterwalk_next(&walk, assoclen, &size); 75 76 unsigned int left = size; 76 - void *mapped = scatterwalk_map(&walk); 77 - const u8 *src = (const u8 *)mapped; 77 + const u8 *src = mapped; 78 78 79 79 if (pos + size >= AEGIS128_BLOCK_SIZE) { 80 80 if (pos > 0) { ··· 97 97 pos += left; 98 98 assoclen -= size; 99 99 100 - scatterwalk_unmap(mapped); 101 - scatterwalk_advance(&walk, size); 102 - scatterwalk_done(&walk, 0, assoclen); 100 + scatterwalk_done_src(&walk, mapped, size); 103 101 } 104 102 105 103 if (pos > 0) {