Commit b455eb80 authored by Herbert Xu's avatar Herbert Xu

crypto: aead - Preserve in-place processing in old_crypt

This patch tries to preserve in-place processing in old_crypt as
various algorithms are optimised for in-place processing where
src == dst.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fdaef75f
...@@ -107,7 +107,8 @@ static int old_crypt(struct aead_request *req, ...@@ -107,7 +107,8 @@ static int old_crypt(struct aead_request *req,
return crypt(req); return crypt(req);
src = scatterwalk_ffwd(nreq->srcbuf, req->src, req->assoclen); src = scatterwalk_ffwd(nreq->srcbuf, req->src, req->assoclen);
dst = scatterwalk_ffwd(nreq->dstbuf, req->dst, req->assoclen); dst = req->src == req->dst ?
src : scatterwalk_ffwd(nreq->dstbuf, req->dst, req->assoclen);
aead_request_set_tfm(&nreq->subreq, aead); aead_request_set_tfm(&nreq->subreq, aead);
aead_request_set_callback(&nreq->subreq, aead_request_flags(req), aead_request_set_callback(&nreq->subreq, aead_request_flags(req),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment