crypto: echainiv - Use skcipher
This patch replaces use of the obsolete blkcipher with skcipher. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
ca0494c093
commit
0e8bff47f6
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include <crypto/internal/geniv.h>
|
#include <crypto/internal/geniv.h>
|
||||||
#include <crypto/scatterwalk.h>
|
#include <crypto/scatterwalk.h>
|
||||||
|
#include <crypto/skcipher.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
|
@ -112,13 +113,16 @@ static int echainiv_encrypt(struct aead_request *req)
|
||||||
info = req->iv;
|
info = req->iv;
|
||||||
|
|
||||||
if (req->src != req->dst) {
|
if (req->src != req->dst) {
|
||||||
struct blkcipher_desc desc = {
|
SKCIPHER_REQUEST_ON_STACK(nreq, ctx->sknull);
|
||||||
.tfm = ctx->null,
|
|
||||||
};
|
|
||||||
|
|
||||||
err = crypto_blkcipher_encrypt(
|
skcipher_request_set_tfm(nreq, ctx->sknull);
|
||||||
&desc, req->dst, req->src,
|
skcipher_request_set_callback(nreq, req->base.flags,
|
||||||
req->assoclen + req->cryptlen);
|
NULL, NULL);
|
||||||
|
skcipher_request_set_crypt(nreq, req->src, req->dst,
|
||||||
|
req->assoclen + req->cryptlen,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
err = crypto_skcipher_encrypt(nreq);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue