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

Configure Feed

Select the types of activity you want to include in your feed.

crypto: null - use memcpy_sglist()

Make null_skcipher_crypt() use memcpy_sglist() instead of the
skcipher_walk API, as this is simpler.

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
aeaad5bf bde39305

+4 -13
+4 -13
crypto/crypto_null.c
··· 15 15 #include <crypto/null.h> 16 16 #include <crypto/internal/hash.h> 17 17 #include <crypto/internal/skcipher.h> 18 + #include <crypto/scatterwalk.h> 18 19 #include <linux/init.h> 19 20 #include <linux/module.h> 20 21 #include <linux/string.h> ··· 61 60 62 61 static int null_skcipher_crypt(struct skcipher_request *req) 63 62 { 64 - struct skcipher_walk walk; 65 - int err; 66 - 67 - err = skcipher_walk_virt(&walk, req, false); 68 - 69 - while (walk.nbytes) { 70 - if (walk.src.virt.addr != walk.dst.virt.addr) 71 - memcpy(walk.dst.virt.addr, walk.src.virt.addr, 72 - walk.nbytes); 73 - err = skcipher_walk_done(&walk, 0); 74 - } 75 - 76 - return err; 63 + if (req->src != req->dst) 64 + memcpy_sglist(req->dst, req->src, req->cryptlen); 65 + return 0; 77 66 } 78 67 79 68 static struct shash_alg digest_null = {