Skip to content

Commit

Permalink
crypto: aead - Preserve in-place processing in old_crypt
Browse files Browse the repository at this point in the history
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: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed May 28, 2015
1 parent fdaef75 commit b455eb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ static int old_crypt(struct aead_request *req,
return crypt(req);

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_callback(&nreq->subreq, aead_request_flags(req),
Expand Down

0 comments on commit b455eb8

Please sign in to comment.