diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2010-11-22 11:26:54 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-12-02 14:47:16 +0800 |
commit | c920fa6051c1e7eb3733eaefd01e5bcdddb3d4c8 (patch) | |
tree | 6f65fd0889e9aa836bf39c953cae3071628ed2df /crypto/eseqiv.c | |
parent | 079f2f7485648c1397a35575fae45908a0db5ba6 (diff) | |
download | linux-stable-c920fa6051c1e7eb3733eaefd01e5bcdddb3d4c8.tar.gz linux-stable-c920fa6051c1e7eb3733eaefd01e5bcdddb3d4c8.tar.bz2 linux-stable-c920fa6051c1e7eb3733eaefd01e5bcdddb3d4c8.zip |
crypto: Use scatterwalk_crypto_chain
Use scatterwalk_crypto_chain in favor of locally defined chaining functions.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/eseqiv.c')
-rw-r--r-- | crypto/eseqiv.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/crypto/eseqiv.c b/crypto/eseqiv.c index 3ca3b669d5d5..42ce9f570aec 100644 --- a/crypto/eseqiv.c +++ b/crypto/eseqiv.c @@ -62,20 +62,6 @@ out: skcipher_givcrypt_complete(req, err); } -static void eseqiv_chain(struct scatterlist *head, struct scatterlist *sg, - int chain) -{ - if (chain) { - head->length += sg->length; - sg = scatterwalk_sg_next(sg); - } - - if (sg) - scatterwalk_sg_chain(head, 2, sg); - else - sg_mark_end(head); -} - static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req) { struct crypto_ablkcipher *geniv = skcipher_givcrypt_reqtfm(req); @@ -124,13 +110,13 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req) sg_init_table(reqctx->src, 2); sg_set_buf(reqctx->src, giv, ivsize); - eseqiv_chain(reqctx->src, osrc, vsrc == giv + ivsize); + scatterwalk_crypto_chain(reqctx->src, osrc, vsrc == giv + ivsize, 2); dst = reqctx->src; if (osrc != odst) { sg_init_table(reqctx->dst, 2); sg_set_buf(reqctx->dst, giv, ivsize); - eseqiv_chain(reqctx->dst, odst, vdst == giv + ivsize); + scatterwalk_crypto_chain(reqctx->dst, odst, vdst == giv + ivsize, 2); dst = reqctx->dst; } |