diff options
Diffstat (limited to 'crypto/gcm.c')
-rw-r--r-- | crypto/gcm.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/crypto/gcm.c b/crypto/gcm.c index b4f017939004..276cdac567b6 100644 --- a/crypto/gcm.c +++ b/crypto/gcm.c | |||
@@ -228,14 +228,14 @@ static void gcm_hash_final_done(struct crypto_async_request *areq, int err); | |||
228 | 228 | ||
229 | static int gcm_hash_update(struct aead_request *req, | 229 | static int gcm_hash_update(struct aead_request *req, |
230 | struct crypto_gcm_req_priv_ctx *pctx, | 230 | struct crypto_gcm_req_priv_ctx *pctx, |
231 | crypto_completion_t complete, | 231 | crypto_completion_t compl, |
232 | struct scatterlist *src, | 232 | struct scatterlist *src, |
233 | unsigned int len) | 233 | unsigned int len) |
234 | { | 234 | { |
235 | struct ahash_request *ahreq = &pctx->u.ahreq; | 235 | struct ahash_request *ahreq = &pctx->u.ahreq; |
236 | 236 | ||
237 | ahash_request_set_callback(ahreq, aead_request_flags(req), | 237 | ahash_request_set_callback(ahreq, aead_request_flags(req), |
238 | complete, req); | 238 | compl, req); |
239 | ahash_request_set_crypt(ahreq, src, NULL, len); | 239 | ahash_request_set_crypt(ahreq, src, NULL, len); |
240 | 240 | ||
241 | return crypto_ahash_update(ahreq); | 241 | return crypto_ahash_update(ahreq); |
@@ -244,12 +244,12 @@ static int gcm_hash_update(struct aead_request *req, | |||
244 | static int gcm_hash_remain(struct aead_request *req, | 244 | static int gcm_hash_remain(struct aead_request *req, |
245 | struct crypto_gcm_req_priv_ctx *pctx, | 245 | struct crypto_gcm_req_priv_ctx *pctx, |
246 | unsigned int remain, | 246 | unsigned int remain, |
247 | crypto_completion_t complete) | 247 | crypto_completion_t compl) |
248 | { | 248 | { |
249 | struct ahash_request *ahreq = &pctx->u.ahreq; | 249 | struct ahash_request *ahreq = &pctx->u.ahreq; |
250 | 250 | ||
251 | ahash_request_set_callback(ahreq, aead_request_flags(req), | 251 | ahash_request_set_callback(ahreq, aead_request_flags(req), |
252 | complete, req); | 252 | compl, req); |
253 | sg_init_one(pctx->src, gcm_zeroes, remain); | 253 | sg_init_one(pctx->src, gcm_zeroes, remain); |
254 | ahash_request_set_crypt(ahreq, pctx->src, NULL, remain); | 254 | ahash_request_set_crypt(ahreq, pctx->src, NULL, remain); |
255 | 255 | ||
@@ -375,14 +375,14 @@ static void __gcm_hash_assoc_remain_done(struct aead_request *req, int err) | |||
375 | { | 375 | { |
376 | struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); | 376 | struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); |
377 | struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; | 377 | struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; |
378 | crypto_completion_t complete; | 378 | crypto_completion_t compl; |
379 | unsigned int remain = 0; | 379 | unsigned int remain = 0; |
380 | 380 | ||
381 | if (!err && gctx->cryptlen) { | 381 | if (!err && gctx->cryptlen) { |
382 | remain = gcm_remain(gctx->cryptlen); | 382 | remain = gcm_remain(gctx->cryptlen); |
383 | complete = remain ? gcm_hash_crypt_done : | 383 | compl = remain ? gcm_hash_crypt_done : |
384 | gcm_hash_crypt_remain_done; | 384 | gcm_hash_crypt_remain_done; |
385 | err = gcm_hash_update(req, pctx, complete, | 385 | err = gcm_hash_update(req, pctx, compl, |
386 | gctx->src, gctx->cryptlen); | 386 | gctx->src, gctx->cryptlen); |
387 | if (err == -EINPROGRESS || err == -EBUSY) | 387 | if (err == -EINPROGRESS || err == -EBUSY) |
388 | return; | 388 | return; |
@@ -429,14 +429,14 @@ static void gcm_hash_assoc_done(struct crypto_async_request *areq, int err) | |||
429 | static void __gcm_hash_init_done(struct aead_request *req, int err) | 429 | static void __gcm_hash_init_done(struct aead_request *req, int err) |
430 | { | 430 | { |
431 | struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); | 431 | struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); |
432 | crypto_completion_t complete; | 432 | crypto_completion_t compl; |
433 | unsigned int remain = 0; | 433 | unsigned int remain = 0; |
434 | 434 | ||
435 | if (!err && req->assoclen) { | 435 | if (!err && req->assoclen) { |
436 | remain = gcm_remain(req->assoclen); | 436 | remain = gcm_remain(req->assoclen); |
437 | complete = remain ? gcm_hash_assoc_done : | 437 | compl = remain ? gcm_hash_assoc_done : |
438 | gcm_hash_assoc_remain_done; | 438 | gcm_hash_assoc_remain_done; |
439 | err = gcm_hash_update(req, pctx, complete, | 439 | err = gcm_hash_update(req, pctx, compl, |
440 | req->assoc, req->assoclen); | 440 | req->assoc, req->assoclen); |
441 | if (err == -EINPROGRESS || err == -EBUSY) | 441 | if (err == -EINPROGRESS || err == -EBUSY) |
442 | return; | 442 | return; |
@@ -462,7 +462,7 @@ static int gcm_hash(struct aead_request *req, | |||
462 | struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; | 462 | struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; |
463 | struct crypto_gcm_ctx *ctx = crypto_tfm_ctx(req->base.tfm); | 463 | struct crypto_gcm_ctx *ctx = crypto_tfm_ctx(req->base.tfm); |
464 | unsigned int remain; | 464 | unsigned int remain; |
465 | crypto_completion_t complete; | 465 | crypto_completion_t compl; |
466 | int err; | 466 | int err; |
467 | 467 | ||
468 | ahash_request_set_tfm(ahreq, ctx->ghash); | 468 | ahash_request_set_tfm(ahreq, ctx->ghash); |
@@ -473,8 +473,8 @@ static int gcm_hash(struct aead_request *req, | |||
473 | if (err) | 473 | if (err) |
474 | return err; | 474 | return err; |
475 | remain = gcm_remain(req->assoclen); | 475 | remain = gcm_remain(req->assoclen); |
476 | complete = remain ? gcm_hash_assoc_done : gcm_hash_assoc_remain_done; | 476 | compl = remain ? gcm_hash_assoc_done : gcm_hash_assoc_remain_done; |
477 | err = gcm_hash_update(req, pctx, complete, req->assoc, req->assoclen); | 477 | err = gcm_hash_update(req, pctx, compl, req->assoc, req->assoclen); |
478 | if (err) | 478 | if (err) |
479 | return err; | 479 | return err; |
480 | if (remain) { | 480 | if (remain) { |
@@ -484,8 +484,8 @@ static int gcm_hash(struct aead_request *req, | |||
484 | return err; | 484 | return err; |
485 | } | 485 | } |
486 | remain = gcm_remain(gctx->cryptlen); | 486 | remain = gcm_remain(gctx->cryptlen); |
487 | complete = remain ? gcm_hash_crypt_done : gcm_hash_crypt_remain_done; | 487 | compl = remain ? gcm_hash_crypt_done : gcm_hash_crypt_remain_done; |
488 | err = gcm_hash_update(req, pctx, complete, gctx->src, gctx->cryptlen); | 488 | err = gcm_hash_update(req, pctx, compl, gctx->src, gctx->cryptlen); |
489 | if (err) | 489 | if (err) |
490 | return err; | 490 | return err; |
491 | if (remain) { | 491 | if (remain) { |