aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/eseqiv.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/eseqiv.c')
-rw-r--r--crypto/eseqiv.c18
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:
62 skcipher_givcrypt_complete(req, err); 62 skcipher_givcrypt_complete(req, err);
63} 63}
64 64
65static void eseqiv_chain(struct scatterlist *head, struct scatterlist *sg,
66 int chain)
67{
68 if (chain) {
69 head->length += sg->length;
70 sg = scatterwalk_sg_next(sg);
71 }
72
73 if (sg)
74 scatterwalk_sg_chain(head, 2, sg);
75 else
76 sg_mark_end(head);
77}
78
79static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req) 65static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req)
80{ 66{
81 struct crypto_ablkcipher *geniv = skcipher_givcrypt_reqtfm(req); 67 struct crypto_ablkcipher *geniv = skcipher_givcrypt_reqtfm(req);
@@ -124,13 +110,13 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req)
124 110
125 sg_init_table(reqctx->src, 2); 111 sg_init_table(reqctx->src, 2);
126 sg_set_buf(reqctx->src, giv, ivsize); 112 sg_set_buf(reqctx->src, giv, ivsize);
127 eseqiv_chain(reqctx->src, osrc, vsrc == giv + ivsize); 113 scatterwalk_crypto_chain(reqctx->src, osrc, vsrc == giv + ivsize, 2);
128 114
129 dst = reqctx->src; 115 dst = reqctx->src;
130 if (osrc != odst) { 116 if (osrc != odst) {
131 sg_init_table(reqctx->dst, 2); 117 sg_init_table(reqctx->dst, 2);
132 sg_set_buf(reqctx->dst, giv, ivsize); 118 sg_set_buf(reqctx->dst, giv, ivsize);
133 eseqiv_chain(reqctx->dst, odst, vdst == giv + ivsize); 119 scatterwalk_crypto_chain(reqctx->dst, odst, vdst == giv + ivsize, 2);
134 120
135 dst = reqctx->dst; 121 dst = reqctx->dst;
136 } 122 }