diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-23 03:41:57 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-25 06:41:32 -0400 |
commit | 374d4ad18a0c4bc844dee42b3b43916e5f46608d (patch) | |
tree | 5ed06f31f36a694f9f8706a309f117735b2f1f00 | |
parent | dd04446e48e859c913a395497ba1a289e707269a (diff) |
crypto: aead - Remove unused cryptoff parameter
This patch removes the cryptoff parameter now that all users
set it to zero.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | crypto/aead.c | 6 | ||||
-rw-r--r-- | crypto/echainiv.c | 4 | ||||
-rw-r--r-- | crypto/seqiv.c | 8 | ||||
-rw-r--r-- | include/crypto/aead.h | 7 |
4 files changed, 9 insertions, 16 deletions
diff --git a/crypto/aead.c b/crypto/aead.c index 070e4b9e94f8..7c3d725bd264 100644 --- a/crypto/aead.c +++ b/crypto/aead.c | |||
@@ -106,10 +106,8 @@ static int old_crypt(struct aead_request *req, | |||
106 | if (req->old) | 106 | if (req->old) |
107 | return crypt(req); | 107 | return crypt(req); |
108 | 108 | ||
109 | src = scatterwalk_ffwd(nreq->srcbuf, req->src, | 109 | src = scatterwalk_ffwd(nreq->srcbuf, req->src, req->assoclen); |
110 | req->assoclen + req->cryptoff); | 110 | dst = scatterwalk_ffwd(nreq->dstbuf, req->dst, req->assoclen); |
111 | dst = scatterwalk_ffwd(nreq->dstbuf, req->dst, | ||
112 | req->assoclen + req->cryptoff); | ||
113 | 111 | ||
114 | aead_request_set_tfm(&nreq->subreq, aead); | 112 | aead_request_set_tfm(&nreq->subreq, aead); |
115 | aead_request_set_callback(&nreq->subreq, aead_request_flags(req), | 113 | aead_request_set_callback(&nreq->subreq, aead_request_flags(req), |
diff --git a/crypto/echainiv.c b/crypto/echainiv.c index 149d8fb87962..bd85dcc4fa3d 100644 --- a/crypto/echainiv.c +++ b/crypto/echainiv.c | |||
@@ -259,7 +259,7 @@ static int echainiv_encrypt(struct aead_request *req) | |||
259 | aead_request_set_callback(subreq, req->base.flags, compl, data); | 259 | aead_request_set_callback(subreq, req->base.flags, compl, data); |
260 | aead_request_set_crypt(subreq, req->dst, req->dst, | 260 | aead_request_set_crypt(subreq, req->dst, req->dst, |
261 | req->cryptlen - ivsize, info); | 261 | req->cryptlen - ivsize, info); |
262 | aead_request_set_ad(subreq, req->assoclen + ivsize, 0); | 262 | aead_request_set_ad(subreq, req->assoclen + ivsize); |
263 | 263 | ||
264 | crypto_xor(info, ctx->salt, ivsize); | 264 | crypto_xor(info, ctx->salt, ivsize); |
265 | scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); | 265 | scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); |
@@ -322,7 +322,7 @@ static int echainiv_decrypt(struct aead_request *req) | |||
322 | aead_request_set_callback(subreq, req->base.flags, compl, data); | 322 | aead_request_set_callback(subreq, req->base.flags, compl, data); |
323 | aead_request_set_crypt(subreq, req->src, req->dst, | 323 | aead_request_set_crypt(subreq, req->src, req->dst, |
324 | req->cryptlen - ivsize, req->iv); | 324 | req->cryptlen - ivsize, req->iv); |
325 | aead_request_set_ad(subreq, req->assoclen + ivsize, 0); | 325 | aead_request_set_ad(subreq, req->assoclen + ivsize); |
326 | 326 | ||
327 | scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0); | 327 | scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0); |
328 | if (req->src != req->dst) | 328 | if (req->src != req->dst) |
diff --git a/crypto/seqiv.c b/crypto/seqiv.c index 16738c5f62bd..127970a69ecf 100644 --- a/crypto/seqiv.c +++ b/crypto/seqiv.c | |||
@@ -337,7 +337,7 @@ static int seqiv_aead_encrypt_compat(struct aead_request *req) | |||
337 | aead_request_set_callback(subreq, req->base.flags, compl, data); | 337 | aead_request_set_callback(subreq, req->base.flags, compl, data); |
338 | aead_request_set_crypt(subreq, dst, dst, | 338 | aead_request_set_crypt(subreq, dst, dst, |
339 | req->cryptlen - ivsize, req->iv); | 339 | req->cryptlen - ivsize, req->iv); |
340 | aead_request_set_ad(subreq, req->assoclen, 0); | 340 | aead_request_set_ad(subreq, req->assoclen); |
341 | 341 | ||
342 | memcpy(buf, req->iv, ivsize); | 342 | memcpy(buf, req->iv, ivsize); |
343 | crypto_xor(buf, ctx->salt, ivsize); | 343 | crypto_xor(buf, ctx->salt, ivsize); |
@@ -406,7 +406,7 @@ static int seqiv_aead_encrypt(struct aead_request *req) | |||
406 | aead_request_set_callback(subreq, req->base.flags, compl, data); | 406 | aead_request_set_callback(subreq, req->base.flags, compl, data); |
407 | aead_request_set_crypt(subreq, req->dst, req->dst, | 407 | aead_request_set_crypt(subreq, req->dst, req->dst, |
408 | req->cryptlen - ivsize, info); | 408 | req->cryptlen - ivsize, info); |
409 | aead_request_set_ad(subreq, req->assoclen + ivsize, 0); | 409 | aead_request_set_ad(subreq, req->assoclen + ivsize); |
410 | 410 | ||
411 | crypto_xor(info, ctx->salt, ivsize); | 411 | crypto_xor(info, ctx->salt, ivsize); |
412 | scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); | 412 | 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 | aead_request_set_callback(subreq, req->base.flags, compl, data); | 473 | aead_request_set_callback(subreq, req->base.flags, compl, data); |
474 | aead_request_set_crypt(subreq, dst, dst, | 474 | aead_request_set_crypt(subreq, dst, dst, |
475 | req->cryptlen - ivsize, req->iv); | 475 | req->cryptlen - ivsize, req->iv); |
476 | aead_request_set_ad(subreq, req->assoclen, 0); | 476 | aead_request_set_ad(subreq, req->assoclen); |
477 | 477 | ||
478 | err = crypto_aead_decrypt(subreq); | 478 | err = crypto_aead_decrypt(subreq); |
479 | if (req->assoclen > 8) | 479 | if (req->assoclen > 8) |
@@ -501,7 +501,7 @@ static int seqiv_aead_decrypt(struct aead_request *req) | |||
501 | aead_request_set_callback(subreq, req->base.flags, compl, data); | 501 | aead_request_set_callback(subreq, req->base.flags, compl, data); |
502 | aead_request_set_crypt(subreq, req->src, req->dst, | 502 | aead_request_set_crypt(subreq, req->src, req->dst, |
503 | req->cryptlen - ivsize, req->iv); | 503 | req->cryptlen - ivsize, req->iv); |
504 | aead_request_set_ad(subreq, req->assoclen + ivsize, 0); | 504 | aead_request_set_ad(subreq, req->assoclen + ivsize); |
505 | 505 | ||
506 | scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0); | 506 | scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0); |
507 | if (req->src != req->dst) | 507 | if (req->src != req->dst) |
diff --git a/include/crypto/aead.h b/include/crypto/aead.h index ba28c61e765f..94141dc1225e 100644 --- a/include/crypto/aead.h +++ b/include/crypto/aead.h | |||
@@ -52,7 +52,6 @@ | |||
52 | * @base: Common attributes for async crypto requests | 52 | * @base: Common attributes for async crypto requests |
53 | * @assoclen: Length in bytes of associated data for authentication | 53 | * @assoclen: Length in bytes of associated data for authentication |
54 | * @cryptlen: Length of data to be encrypted or decrypted | 54 | * @cryptlen: Length of data to be encrypted or decrypted |
55 | * @cryptoff: Bytes to skip after AD before plain/cipher text | ||
56 | * @iv: Initialisation vector | 55 | * @iv: Initialisation vector |
57 | * @assoc: Associated data | 56 | * @assoc: Associated data |
58 | * @src: Source data | 57 | * @src: Source data |
@@ -66,7 +65,6 @@ struct aead_request { | |||
66 | 65 | ||
67 | unsigned int assoclen; | 66 | unsigned int assoclen; |
68 | unsigned int cryptlen; | 67 | unsigned int cryptlen; |
69 | unsigned int cryptoff; | ||
70 | 68 | ||
71 | u8 *iv; | 69 | u8 *iv; |
72 | 70 | ||
@@ -525,18 +523,15 @@ static inline void aead_request_set_assoc(struct aead_request *req, | |||
525 | * aead_request_set_ad - set associated data information | 523 | * aead_request_set_ad - set associated data information |
526 | * @req: request handle | 524 | * @req: request handle |
527 | * @assoclen: number of bytes in associated data | 525 | * @assoclen: number of bytes in associated data |
528 | * @cryptoff: Number of bytes to skip after AD before plain/cipher text | ||
529 | * | 526 | * |
530 | * Setting the AD information. This function sets the length of | 527 | * Setting the AD information. This function sets the length of |
531 | * the associated data and the number of bytes to skip after it to | 528 | * the associated data and the number of bytes to skip after it to |
532 | * access the plain/cipher text. | 529 | * access the plain/cipher text. |
533 | */ | 530 | */ |
534 | static inline void aead_request_set_ad(struct aead_request *req, | 531 | static inline void aead_request_set_ad(struct aead_request *req, |
535 | unsigned int assoclen, | 532 | unsigned int assoclen) |
536 | unsigned int cryptoff) | ||
537 | { | 533 | { |
538 | req->assoclen = assoclen; | 534 | req->assoclen = assoclen; |
539 | req->cryptoff = cryptoff; | ||
540 | req->old = false; | 535 | req->old = false; |
541 | } | 536 | } |
542 | 537 | ||