Commit 374d4ad1 authored by Herbert Xu's avatar Herbert Xu

crypto: aead - Remove unused cryptoff parameter

This patch removes the cryptoff parameter now that all users
set it to zero.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent dd04446e
...@@ -106,10 +106,8 @@ static int old_crypt(struct aead_request *req, ...@@ -106,10 +106,8 @@ static int old_crypt(struct aead_request *req,
if (req->old) if (req->old)
return crypt(req); return crypt(req);
src = scatterwalk_ffwd(nreq->srcbuf, req->src, src = scatterwalk_ffwd(nreq->srcbuf, req->src, req->assoclen);
req->assoclen + req->cryptoff); dst = scatterwalk_ffwd(nreq->dstbuf, req->dst, req->assoclen);
dst = scatterwalk_ffwd(nreq->dstbuf, req->dst,
req->assoclen + req->cryptoff);
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),
......
...@@ -259,7 +259,7 @@ static int echainiv_encrypt(struct aead_request *req) ...@@ -259,7 +259,7 @@ static int echainiv_encrypt(struct aead_request *req)
aead_request_set_callback(subreq, req->base.flags, compl, data); aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, req->dst, req->dst, aead_request_set_crypt(subreq, req->dst, req->dst,
req->cryptlen - ivsize, info); req->cryptlen - ivsize, info);
aead_request_set_ad(subreq, req->assoclen + ivsize, 0); aead_request_set_ad(subreq, req->assoclen + ivsize);
crypto_xor(info, ctx->salt, ivsize); crypto_xor(info, ctx->salt, ivsize);
scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1);
...@@ -322,7 +322,7 @@ static int echainiv_decrypt(struct aead_request *req) ...@@ -322,7 +322,7 @@ static int echainiv_decrypt(struct aead_request *req)
aead_request_set_callback(subreq, req->base.flags, compl, data); aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, req->src, req->dst, aead_request_set_crypt(subreq, req->src, req->dst,
req->cryptlen - ivsize, req->iv); req->cryptlen - ivsize, req->iv);
aead_request_set_ad(subreq, req->assoclen + ivsize, 0); aead_request_set_ad(subreq, req->assoclen + ivsize);
scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0); scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0);
if (req->src != req->dst) if (req->src != req->dst)
......
...@@ -337,7 +337,7 @@ static int seqiv_aead_encrypt_compat(struct aead_request *req) ...@@ -337,7 +337,7 @@ static int seqiv_aead_encrypt_compat(struct aead_request *req)
aead_request_set_callback(subreq, req->base.flags, compl, data); aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, dst, dst, aead_request_set_crypt(subreq, dst, dst,
req->cryptlen - ivsize, req->iv); req->cryptlen - ivsize, req->iv);
aead_request_set_ad(subreq, req->assoclen, 0); aead_request_set_ad(subreq, req->assoclen);
memcpy(buf, req->iv, ivsize); memcpy(buf, req->iv, ivsize);
crypto_xor(buf, ctx->salt, ivsize); crypto_xor(buf, ctx->salt, ivsize);
...@@ -406,7 +406,7 @@ static int seqiv_aead_encrypt(struct aead_request *req) ...@@ -406,7 +406,7 @@ static int seqiv_aead_encrypt(struct aead_request *req)
aead_request_set_callback(subreq, req->base.flags, compl, data); aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, req->dst, req->dst, aead_request_set_crypt(subreq, req->dst, req->dst,
req->cryptlen - ivsize, info); req->cryptlen - ivsize, info);
aead_request_set_ad(subreq, req->assoclen + ivsize, 0); aead_request_set_ad(subreq, req->assoclen + ivsize);
crypto_xor(info, ctx->salt, ivsize); crypto_xor(info, ctx->salt, ivsize);
scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1);
...@@ -473,7 +473,7 @@ static int seqiv_aead_decrypt_compat(struct aead_request *req) ...@@ -473,7 +473,7 @@ static int seqiv_aead_decrypt_compat(struct aead_request *req)
aead_request_set_callback(subreq, req->base.flags, compl, data); aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, dst, dst, aead_request_set_crypt(subreq, dst, dst,
req->cryptlen - ivsize, req->iv); req->cryptlen - ivsize, req->iv);
aead_request_set_ad(subreq, req->assoclen, 0); aead_request_set_ad(subreq, req->assoclen);
err = crypto_aead_decrypt(subreq); err = crypto_aead_decrypt(subreq);
if (req->assoclen > 8) if (req->assoclen > 8)
...@@ -501,7 +501,7 @@ static int seqiv_aead_decrypt(struct aead_request *req) ...@@ -501,7 +501,7 @@ static int seqiv_aead_decrypt(struct aead_request *req)
aead_request_set_callback(subreq, req->base.flags, compl, data); aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, req->src, req->dst, aead_request_set_crypt(subreq, req->src, req->dst,
req->cryptlen - ivsize, req->iv); req->cryptlen - ivsize, req->iv);
aead_request_set_ad(subreq, req->assoclen + ivsize, 0); aead_request_set_ad(subreq, req->assoclen + ivsize);
scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0); scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0);
if (req->src != req->dst) if (req->src != req->dst)
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
* @base: Common attributes for async crypto requests * @base: Common attributes for async crypto requests
* @assoclen: Length in bytes of associated data for authentication * @assoclen: Length in bytes of associated data for authentication
* @cryptlen: Length of data to be encrypted or decrypted * @cryptlen: Length of data to be encrypted or decrypted
* @cryptoff: Bytes to skip after AD before plain/cipher text
* @iv: Initialisation vector * @iv: Initialisation vector
* @assoc: Associated data * @assoc: Associated data
* @src: Source data * @src: Source data
...@@ -66,7 +65,6 @@ struct aead_request { ...@@ -66,7 +65,6 @@ struct aead_request {
unsigned int assoclen; unsigned int assoclen;
unsigned int cryptlen; unsigned int cryptlen;
unsigned int cryptoff;
u8 *iv; u8 *iv;
...@@ -525,18 +523,15 @@ static inline void aead_request_set_assoc(struct aead_request *req, ...@@ -525,18 +523,15 @@ static inline void aead_request_set_assoc(struct aead_request *req,
* aead_request_set_ad - set associated data information * aead_request_set_ad - set associated data information
* @req: request handle * @req: request handle
* @assoclen: number of bytes in associated data * @assoclen: number of bytes in associated data
* @cryptoff: Number of bytes to skip after AD before plain/cipher text
* *
* Setting the AD information. This function sets the length of * Setting the AD information. This function sets the length of
* the associated data and the number of bytes to skip after it to * the associated data and the number of bytes to skip after it to
* access the plain/cipher text. * access the plain/cipher text.
*/ */
static inline void aead_request_set_ad(struct aead_request *req, static inline void aead_request_set_ad(struct aead_request *req,
unsigned int assoclen, unsigned int assoclen)
unsigned int cryptoff)
{ {
req->assoclen = assoclen; req->assoclen = assoclen;
req->cryptoff = cryptoff;
req->old = false; req->old = false;
} }
......
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