crypto: aead - Remove unused cryptoff parameter
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 23 May 2015 07:41:57 +0000 (15:41 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 25 May 2015 10:41:32 +0000 (18:41 +0800)
This patch removes the cryptoff parameter now that all users
set it to zero.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/aead.c
crypto/echainiv.c
crypto/seqiv.c
include/crypto/aead.h

index 070e4b9e94f8bc890d31e8e9334a53850b3e7fa2..7c3d725bd26481bbc9b4574736510b9f0f3090b4 100644 (file)
@@ -106,10 +106,8 @@ static int old_crypt(struct aead_request *req,
        if (req->old)
                return crypt(req);
 
-       src = scatterwalk_ffwd(nreq->srcbuf, req->src,
-                              req->assoclen + req->cryptoff);
-       dst = scatterwalk_ffwd(nreq->dstbuf, req->dst,
-                              req->assoclen + req->cryptoff);
+       src = scatterwalk_ffwd(nreq->srcbuf, req->src, req->assoclen);
+       dst = 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),
index 149d8fb8796214b8a3cdb30cb7c994709b5db6f7..bd85dcc4fa3d07c7de79abaf950008fa351ff0b5 100644 (file)
@@ -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_crypt(subreq, req->dst, req->dst,
                               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);
        scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1);
@@ -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_crypt(subreq, req->src, req->dst,
                               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);
        if (req->src != req->dst)
index 16738c5f62bd80bcf9920433ac474a03678f53d8..127970a69ecfcc58082a8377864506a8e7d040dd 100644 (file)
@@ -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_crypt(subreq, dst, dst,
                               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);
        crypto_xor(buf, ctx->salt, ivsize);
@@ -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_crypt(subreq, req->dst, req->dst,
                               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);
        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)
        aead_request_set_callback(subreq, req->base.flags, compl, data);
        aead_request_set_crypt(subreq, dst, dst,
                               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);
        if (req->assoclen > 8)
@@ -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_crypt(subreq, req->src, req->dst,
                               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);
        if (req->src != req->dst)
index ba28c61e765fb53ff2ddfa8a7e27e0609e19580d..94141dc1225eb80345f9c61f4ef014b30f41ef55 100644 (file)
@@ -52,7 +52,6 @@
  *     @base: Common attributes for async crypto requests
  *     @assoclen: Length in bytes of associated data for authentication
  *     @cryptlen: Length of data to be encrypted or decrypted
- *     @cryptoff: Bytes to skip after AD before plain/cipher text
  *     @iv: Initialisation vector
  *     @assoc: Associated data
  *     @src: Source data
@@ -66,7 +65,6 @@ struct aead_request {
 
        unsigned int assoclen;
        unsigned int cryptlen;
-       unsigned int cryptoff;
 
        u8 *iv;
 
@@ -525,18 +523,15 @@ static inline void aead_request_set_assoc(struct aead_request *req,
  * aead_request_set_ad - set associated data information
  * @req: request handle
  * @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
  * the associated data and the number of bytes to skip after it to
  * access the plain/cipher text.
  */
 static inline void aead_request_set_ad(struct aead_request *req,
-                                      unsigned int assoclen,
-                                      unsigned int cryptoff)
+                                      unsigned int assoclen)
 {
        req->assoclen = assoclen;
-       req->cryptoff = cryptoff;
        req->old = false;
 }