Skip to content

Commit

Permalink
crypto: echainiv - Use skcipher
Browse files Browse the repository at this point in the history
This patch replaces use of the obsolete blkcipher with skcipher.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Jul 18, 2016
1 parent ca0494c commit 0e8bff4
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crypto/echainiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <crypto/internal/geniv.h>
#include <crypto/scatterwalk.h>
#include <crypto/skcipher.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
Expand Down Expand Up @@ -112,13 +113,16 @@ static int echainiv_encrypt(struct aead_request *req)
info = req->iv;

if (req->src != req->dst) {
struct blkcipher_desc desc = {
.tfm = ctx->null,
};
SKCIPHER_REQUEST_ON_STACK(nreq, ctx->sknull);

err = crypto_blkcipher_encrypt(
&desc, req->dst, req->src,
req->assoclen + req->cryptlen);
skcipher_request_set_tfm(nreq, ctx->sknull);
skcipher_request_set_callback(nreq, req->base.flags,
NULL, NULL);
skcipher_request_set_crypt(nreq, req->src, req->dst,
req->assoclen + req->cryptlen,
NULL);

err = crypto_skcipher_encrypt(nreq);
if (err)
return err;
}
Expand Down

0 comments on commit 0e8bff4

Please sign in to comment.