Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: ahash - optimize performance when wrapping shash

The "ahash" API provides access to both CPU-based and hardware offload-
based implementations of hash algorithms. Typically the former are
implemented as "shash" algorithms under the hood, while the latter are
implemented as "ahash" algorithms. The "ahash" API provides access to
both. Various kernel subsystems use the ahash API because they want to
support hashing hardware offload without using a separate API for it.

Yet, the common case is that a crypto accelerator is not actually being
used, and ahash is just wrapping a CPU-based shash algorithm.

This patch optimizes the ahash API for that common case by eliminating
the extra indirect call for each ahash operation on top of shash.

It also fixes the double-counting of crypto stats in this scenario
(though CONFIG_CRYPTO_STATS should *not* be enabled by anyone interested
in performance anyway...), and it eliminates redundant checking of
CRYPTO_TFM_NEED_KEY. As a bonus, it also shrinks struct crypto_ahash.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
2f1f34c1 85b84327

+167 -204
+145 -140
crypto/ahash.c
··· 27 27 28 28 #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000e 29 29 30 - static int shash_async_setkey(struct crypto_ahash *tfm, const u8 *key, 31 - unsigned int keylen) 30 + static inline struct crypto_istat_hash *ahash_get_stat(struct ahash_alg *alg) 32 31 { 33 - struct crypto_shash **ctx = crypto_ahash_ctx(tfm); 34 - 35 - return crypto_shash_setkey(*ctx, key, keylen); 32 + return hash_get_stat(&alg->halg); 36 33 } 37 34 38 - static int shash_async_init(struct ahash_request *req) 35 + static inline int crypto_ahash_errstat(struct ahash_alg *alg, int err) 39 36 { 40 - struct crypto_shash **ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(req)); 37 + if (!IS_ENABLED(CONFIG_CRYPTO_STATS)) 38 + return err; 39 + 40 + if (err && err != -EINPROGRESS && err != -EBUSY) 41 + atomic64_inc(&ahash_get_stat(alg)->err_cnt); 42 + 43 + return err; 44 + } 45 + 46 + /* 47 + * For an ahash tfm that is using an shash algorithm (instead of an ahash 48 + * algorithm), this returns the underlying shash tfm. 49 + */ 50 + static inline struct crypto_shash *ahash_to_shash(struct crypto_ahash *tfm) 51 + { 52 + return *(struct crypto_shash **)crypto_ahash_ctx(tfm); 53 + } 54 + 55 + static inline struct shash_desc *prepare_shash_desc(struct ahash_request *req, 56 + struct crypto_ahash *tfm) 57 + { 41 58 struct shash_desc *desc = ahash_request_ctx(req); 42 59 43 - desc->tfm = *ctx; 44 - 45 - return crypto_shash_init(desc); 60 + desc->tfm = ahash_to_shash(tfm); 61 + return desc; 46 62 } 47 63 48 64 int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc) ··· 73 57 return nbytes; 74 58 } 75 59 EXPORT_SYMBOL_GPL(shash_ahash_update); 76 - 77 - static int shash_async_update(struct ahash_request *req) 78 - { 79 - return shash_ahash_update(req, ahash_request_ctx(req)); 80 - } 81 - 82 - static int shash_async_final(struct ahash_request *req) 83 - { 84 - return crypto_shash_final(ahash_request_ctx(req), req->result); 85 - } 86 60 87 61 int shash_ahash_finup(struct ahash_request *req, struct shash_desc *desc) 88 62 { ··· 94 88 return nbytes; 95 89 } 96 90 EXPORT_SYMBOL_GPL(shash_ahash_finup); 97 - 98 - static int shash_async_finup(struct ahash_request *req) 99 - { 100 - struct crypto_shash **ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(req)); 101 - struct shash_desc *desc = ahash_request_ctx(req); 102 - 103 - desc->tfm = *ctx; 104 - 105 - return shash_ahash_finup(req, desc); 106 - } 107 91 108 92 int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc) 109 93 { ··· 119 123 } 120 124 EXPORT_SYMBOL_GPL(shash_ahash_digest); 121 125 122 - static int shash_async_digest(struct ahash_request *req) 123 - { 124 - struct crypto_shash **ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(req)); 125 - struct shash_desc *desc = ahash_request_ctx(req); 126 - 127 - desc->tfm = *ctx; 128 - 129 - return shash_ahash_digest(req, desc); 130 - } 131 - 132 - static int shash_async_export(struct ahash_request *req, void *out) 133 - { 134 - return crypto_shash_export(ahash_request_ctx(req), out); 135 - } 136 - 137 - static int shash_async_import(struct ahash_request *req, const void *in) 138 - { 139 - struct crypto_shash **ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(req)); 140 - struct shash_desc *desc = ahash_request_ctx(req); 141 - 142 - desc->tfm = *ctx; 143 - 144 - return crypto_shash_import(desc, in); 145 - } 146 - 147 - static void crypto_exit_shash_ops_async(struct crypto_tfm *tfm) 126 + static void crypto_exit_ahash_using_shash(struct crypto_tfm *tfm) 148 127 { 149 128 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); 150 129 151 130 crypto_free_shash(*ctx); 152 131 } 153 132 154 - static int crypto_init_shash_ops_async(struct crypto_tfm *tfm) 133 + static int crypto_init_ahash_using_shash(struct crypto_tfm *tfm) 155 134 { 156 135 struct crypto_alg *calg = tfm->__crt_alg; 157 - struct shash_alg *alg = __crypto_shash_alg(calg); 158 136 struct crypto_ahash *crt = __crypto_ahash_cast(tfm); 159 137 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); 160 138 struct crypto_shash *shash; ··· 142 172 return PTR_ERR(shash); 143 173 } 144 174 175 + crt->using_shash = true; 145 176 *ctx = shash; 146 - tfm->exit = crypto_exit_shash_ops_async; 147 - 148 - crt->init = shash_async_init; 149 - crt->update = shash_async_update; 150 - crt->final = shash_async_final; 151 - crt->finup = shash_async_finup; 152 - crt->digest = shash_async_digest; 153 - if (crypto_shash_alg_has_setkey(alg)) 154 - crt->setkey = shash_async_setkey; 177 + tfm->exit = crypto_exit_ahash_using_shash; 155 178 156 179 crypto_ahash_set_flags(crt, crypto_shash_get_flags(shash) & 157 180 CRYPTO_TFM_NEED_KEY); 158 - 159 - crt->export = shash_async_export; 160 - crt->import = shash_async_import; 161 - 162 181 crt->reqsize = sizeof(struct shash_desc) + crypto_shash_descsize(shash); 163 182 164 183 return 0; 165 - } 166 - 167 - static struct crypto_ahash * 168 - crypto_clone_shash_ops_async(struct crypto_ahash *nhash, 169 - struct crypto_ahash *hash) 170 - { 171 - struct crypto_shash **nctx = crypto_ahash_ctx(nhash); 172 - struct crypto_shash **ctx = crypto_ahash_ctx(hash); 173 - struct crypto_shash *shash; 174 - 175 - shash = crypto_clone_shash(*ctx); 176 - if (IS_ERR(shash)) { 177 - crypto_free_ahash(nhash); 178 - return ERR_CAST(shash); 179 - } 180 - 181 - *nctx = shash; 182 - 183 - return nhash; 184 184 } 185 185 186 186 static int hash_walk_next(struct crypto_hash_walk *walk) ··· 230 290 return -ENOSYS; 231 291 } 232 292 233 - static void ahash_set_needkey(struct crypto_ahash *tfm) 293 + static void ahash_set_needkey(struct crypto_ahash *tfm, struct ahash_alg *alg) 234 294 { 235 - const struct hash_alg_common *alg = crypto_hash_alg_common(tfm); 236 - 237 - if (tfm->setkey != ahash_nosetkey && 238 - !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) 295 + if (alg->setkey != ahash_nosetkey && 296 + !(alg->halg.base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) 239 297 crypto_ahash_set_flags(tfm, CRYPTO_TFM_NEED_KEY); 240 298 } 241 299 242 300 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key, 243 301 unsigned int keylen) 244 302 { 245 - int err = tfm->setkey(tfm, key, keylen); 303 + if (likely(tfm->using_shash)) { 304 + struct crypto_shash *shash = ahash_to_shash(tfm); 305 + int err; 246 306 247 - if (unlikely(err)) { 248 - ahash_set_needkey(tfm); 249 - return err; 307 + err = crypto_shash_setkey(shash, key, keylen); 308 + if (unlikely(err)) { 309 + crypto_ahash_set_flags(tfm, 310 + crypto_shash_get_flags(shash) & 311 + CRYPTO_TFM_NEED_KEY); 312 + return err; 313 + } 314 + } else { 315 + struct ahash_alg *alg = crypto_ahash_alg(tfm); 316 + int err; 317 + 318 + err = alg->setkey(tfm, key, keylen); 319 + if (unlikely(err)) { 320 + ahash_set_needkey(tfm, alg); 321 + return err; 322 + } 250 323 } 251 - 252 324 crypto_ahash_clear_flags(tfm, CRYPTO_TFM_NEED_KEY); 253 325 return 0; 254 326 } 255 327 EXPORT_SYMBOL_GPL(crypto_ahash_setkey); 328 + 329 + int crypto_ahash_init(struct ahash_request *req) 330 + { 331 + struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 332 + 333 + if (likely(tfm->using_shash)) 334 + return crypto_shash_init(prepare_shash_desc(req, tfm)); 335 + if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) 336 + return -ENOKEY; 337 + return crypto_ahash_alg(tfm)->init(req); 338 + } 339 + EXPORT_SYMBOL_GPL(crypto_ahash_init); 256 340 257 341 static int ahash_save_req(struct ahash_request *req, crypto_completion_t cplt, 258 342 bool has_state) ··· 341 377 kfree_sensitive(subreq); 342 378 } 343 379 380 + int crypto_ahash_update(struct ahash_request *req) 381 + { 382 + struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 383 + struct ahash_alg *alg; 384 + 385 + if (likely(tfm->using_shash)) 386 + return shash_ahash_update(req, ahash_request_ctx(req)); 387 + 388 + alg = crypto_ahash_alg(tfm); 389 + if (IS_ENABLED(CONFIG_CRYPTO_STATS)) 390 + atomic64_add(req->nbytes, &ahash_get_stat(alg)->hash_tlen); 391 + return crypto_ahash_errstat(alg, alg->update(req)); 392 + } 393 + EXPORT_SYMBOL_GPL(crypto_ahash_update); 394 + 344 395 int crypto_ahash_final(struct ahash_request *req) 345 396 { 346 397 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 347 - struct hash_alg_common *alg = crypto_hash_alg_common(tfm); 398 + struct ahash_alg *alg; 348 399 400 + if (likely(tfm->using_shash)) 401 + return crypto_shash_final(ahash_request_ctx(req), req->result); 402 + 403 + alg = crypto_ahash_alg(tfm); 349 404 if (IS_ENABLED(CONFIG_CRYPTO_STATS)) 350 - atomic64_inc(&hash_get_stat(alg)->hash_cnt); 351 - 352 - return crypto_hash_errstat(alg, tfm->final(req)); 405 + atomic64_inc(&ahash_get_stat(alg)->hash_cnt); 406 + return crypto_ahash_errstat(alg, alg->final(req)); 353 407 } 354 408 EXPORT_SYMBOL_GPL(crypto_ahash_final); 355 409 356 410 int crypto_ahash_finup(struct ahash_request *req) 357 411 { 358 412 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 359 - struct hash_alg_common *alg = crypto_hash_alg_common(tfm); 413 + struct ahash_alg *alg; 360 414 415 + if (likely(tfm->using_shash)) 416 + return shash_ahash_finup(req, ahash_request_ctx(req)); 417 + 418 + alg = crypto_ahash_alg(tfm); 361 419 if (IS_ENABLED(CONFIG_CRYPTO_STATS)) { 362 - struct crypto_istat_hash *istat = hash_get_stat(alg); 420 + struct crypto_istat_hash *istat = ahash_get_stat(alg); 363 421 364 422 atomic64_inc(&istat->hash_cnt); 365 423 atomic64_add(req->nbytes, &istat->hash_tlen); 366 424 } 367 - 368 - return crypto_hash_errstat(alg, tfm->finup(req)); 425 + return crypto_ahash_errstat(alg, alg->finup(req)); 369 426 } 370 427 EXPORT_SYMBOL_GPL(crypto_ahash_finup); 371 428 372 429 int crypto_ahash_digest(struct ahash_request *req) 373 430 { 374 431 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 375 - struct hash_alg_common *alg = crypto_hash_alg_common(tfm); 432 + struct ahash_alg *alg; 376 433 int err; 377 434 435 + if (likely(tfm->using_shash)) 436 + return shash_ahash_digest(req, prepare_shash_desc(req, tfm)); 437 + 438 + alg = crypto_ahash_alg(tfm); 378 439 if (IS_ENABLED(CONFIG_CRYPTO_STATS)) { 379 - struct crypto_istat_hash *istat = hash_get_stat(alg); 440 + struct crypto_istat_hash *istat = ahash_get_stat(alg); 380 441 381 442 atomic64_inc(&istat->hash_cnt); 382 443 atomic64_add(req->nbytes, &istat->hash_tlen); ··· 410 421 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) 411 422 err = -ENOKEY; 412 423 else 413 - err = tfm->digest(req); 424 + err = alg->digest(req); 414 425 415 - return crypto_hash_errstat(alg, err); 426 + return crypto_ahash_errstat(alg, err); 416 427 } 417 428 EXPORT_SYMBOL_GPL(crypto_ahash_digest); 418 429 ··· 437 448 438 449 subreq->base.complete = ahash_def_finup_done2; 439 450 440 - err = crypto_ahash_reqtfm(req)->final(subreq); 451 + err = crypto_ahash_alg(crypto_ahash_reqtfm(req))->final(subreq); 441 452 if (err == -EINPROGRESS || err == -EBUSY) 442 453 return err; 443 454 ··· 474 485 if (err) 475 486 return err; 476 487 477 - err = tfm->update(req->priv); 488 + err = crypto_ahash_alg(tfm)->update(req->priv); 478 489 if (err == -EINPROGRESS || err == -EBUSY) 479 490 return err; 480 491 481 492 return ahash_def_finup_finish1(req, err); 482 493 } 494 + 495 + int crypto_ahash_export(struct ahash_request *req, void *out) 496 + { 497 + struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 498 + 499 + if (likely(tfm->using_shash)) 500 + return crypto_shash_export(ahash_request_ctx(req), out); 501 + return crypto_ahash_alg(tfm)->export(req, out); 502 + } 503 + EXPORT_SYMBOL_GPL(crypto_ahash_export); 504 + 505 + int crypto_ahash_import(struct ahash_request *req, const void *in) 506 + { 507 + struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 508 + 509 + if (likely(tfm->using_shash)) 510 + return crypto_shash_import(prepare_shash_desc(req, tfm), in); 511 + if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) 512 + return -ENOKEY; 513 + return crypto_ahash_alg(tfm)->import(req, in); 514 + } 515 + EXPORT_SYMBOL_GPL(crypto_ahash_import); 483 516 484 517 static void crypto_ahash_exit_tfm(struct crypto_tfm *tfm) 485 518 { ··· 516 505 struct crypto_ahash *hash = __crypto_ahash_cast(tfm); 517 506 struct ahash_alg *alg = crypto_ahash_alg(hash); 518 507 519 - hash->setkey = ahash_nosetkey; 520 - 521 508 crypto_ahash_set_statesize(hash, alg->halg.statesize); 522 509 523 510 if (tfm->__crt_alg->cra_type == &crypto_shash_type) 524 - return crypto_init_shash_ops_async(tfm); 511 + return crypto_init_ahash_using_shash(tfm); 525 512 526 - hash->init = alg->init; 527 - hash->update = alg->update; 528 - hash->final = alg->final; 529 - hash->finup = alg->finup ?: ahash_def_finup; 530 - hash->digest = alg->digest; 531 - hash->export = alg->export; 532 - hash->import = alg->import; 533 - 534 - if (alg->setkey) { 535 - hash->setkey = alg->setkey; 536 - ahash_set_needkey(hash); 537 - } 513 + ahash_set_needkey(hash, alg); 538 514 539 515 if (alg->exit_tfm) 540 516 tfm->exit = crypto_ahash_exit_tfm; ··· 639 641 if (IS_ERR(nhash)) 640 642 return nhash; 641 643 642 - nhash->init = hash->init; 643 - nhash->update = hash->update; 644 - nhash->final = hash->final; 645 - nhash->finup = hash->finup; 646 - nhash->digest = hash->digest; 647 - nhash->export = hash->export; 648 - nhash->import = hash->import; 649 - nhash->setkey = hash->setkey; 650 644 nhash->reqsize = hash->reqsize; 651 645 nhash->statesize = hash->statesize; 652 646 653 - if (tfm->__crt_alg->cra_type != &crypto_ahash_type) 654 - return crypto_clone_shash_ops_async(nhash, hash); 647 + if (likely(hash->using_shash)) { 648 + struct crypto_shash **nctx = crypto_ahash_ctx(nhash); 649 + struct crypto_shash *shash; 650 + 651 + shash = crypto_clone_shash(ahash_to_shash(hash)); 652 + if (IS_ERR(shash)) { 653 + err = PTR_ERR(shash); 654 + goto out_free_nhash; 655 + } 656 + *nctx = shash; 657 + return nhash; 658 + } 655 659 656 660 err = -ENOSYS; 657 661 alg = crypto_ahash_alg(hash); ··· 686 686 687 687 base->cra_type = &crypto_ahash_type; 688 688 base->cra_flags |= CRYPTO_ALG_TYPE_AHASH; 689 + 690 + if (!alg->finup) 691 + alg->finup = ahash_def_finup; 692 + if (!alg->setkey) 693 + alg->setkey = ahash_nosetkey; 689 694 690 695 return 0; 691 696 } ··· 766 761 if (alg->cra_type == &crypto_shash_type) 767 762 return crypto_shash_alg_has_setkey(__crypto_shash_alg(alg)); 768 763 769 - return __crypto_ahash_alg(alg)->setkey != NULL; 764 + return __crypto_ahash_alg(alg)->setkey != ahash_nosetkey; 770 765 } 771 766 EXPORT_SYMBOL_GPL(crypto_hash_alg_has_setkey); 772 767
+10
crypto/hash.h
··· 12 12 13 13 #include "internal.h" 14 14 15 + static inline struct crypto_istat_hash *hash_get_stat( 16 + struct hash_alg_common *alg) 17 + { 18 + #ifdef CONFIG_CRYPTO_STATS 19 + return &alg->stat; 20 + #else 21 + return NULL; 22 + #endif 23 + } 24 + 15 25 static inline int crypto_hash_report_stat(struct sk_buff *skb, 16 26 struct crypto_alg *alg, 17 27 const char *type)
+7 -1
crypto/shash.c
··· 23 23 24 24 static inline int crypto_shash_errstat(struct shash_alg *alg, int err) 25 25 { 26 - return crypto_hash_errstat(&alg->halg, err); 26 + if (!IS_ENABLED(CONFIG_CRYPTO_STATS)) 27 + return err; 28 + 29 + if (err && err != -EINPROGRESS && err != -EBUSY) 30 + atomic64_inc(&shash_get_stat(alg)->err_cnt); 31 + 32 + return err; 27 33 } 28 34 29 35 int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
+5 -63
include/crypto/hash.h
··· 250 250 #undef HASH_ALG_COMMON_STAT 251 251 252 252 struct crypto_ahash { 253 - int (*init)(struct ahash_request *req); 254 - int (*update)(struct ahash_request *req); 255 - int (*final)(struct ahash_request *req); 256 - int (*finup)(struct ahash_request *req); 257 - int (*digest)(struct ahash_request *req); 258 - int (*export)(struct ahash_request *req, void *out); 259 - int (*import)(struct ahash_request *req, const void *in); 260 - int (*setkey)(struct crypto_ahash *tfm, const u8 *key, 261 - unsigned int keylen); 262 - 253 + bool using_shash; /* Underlying algorithm is shash, not ahash */ 263 254 unsigned int statesize; 264 255 unsigned int reqsize; 265 256 struct crypto_tfm base; ··· 504 513 * 505 514 * Return: 0 if the export was successful; < 0 if an error occurred 506 515 */ 507 - static inline int crypto_ahash_export(struct ahash_request *req, void *out) 508 - { 509 - return crypto_ahash_reqtfm(req)->export(req, out); 510 - } 516 + int crypto_ahash_export(struct ahash_request *req, void *out); 511 517 512 518 /** 513 519 * crypto_ahash_import() - import message digest state ··· 517 529 * 518 530 * Return: 0 if the import was successful; < 0 if an error occurred 519 531 */ 520 - static inline int crypto_ahash_import(struct ahash_request *req, const void *in) 521 - { 522 - struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 523 - 524 - if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) 525 - return -ENOKEY; 526 - 527 - return tfm->import(req, in); 528 - } 532 + int crypto_ahash_import(struct ahash_request *req, const void *in); 529 533 530 534 /** 531 535 * crypto_ahash_init() - (re)initialize message digest handle ··· 530 550 * 531 551 * Return: see crypto_ahash_final() 532 552 */ 533 - static inline int crypto_ahash_init(struct ahash_request *req) 534 - { 535 - struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 536 - 537 - if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) 538 - return -ENOKEY; 539 - 540 - return tfm->init(req); 541 - } 542 - 543 - static inline struct crypto_istat_hash *hash_get_stat( 544 - struct hash_alg_common *alg) 545 - { 546 - #ifdef CONFIG_CRYPTO_STATS 547 - return &alg->stat; 548 - #else 549 - return NULL; 550 - #endif 551 - } 552 - 553 - static inline int crypto_hash_errstat(struct hash_alg_common *alg, int err) 554 - { 555 - if (!IS_ENABLED(CONFIG_CRYPTO_STATS)) 556 - return err; 557 - 558 - if (err && err != -EINPROGRESS && err != -EBUSY) 559 - atomic64_inc(&hash_get_stat(alg)->err_cnt); 560 - 561 - return err; 562 - } 553 + int crypto_ahash_init(struct ahash_request *req); 563 554 564 555 /** 565 556 * crypto_ahash_update() - add data to message digest for processing ··· 543 592 * 544 593 * Return: see crypto_ahash_final() 545 594 */ 546 - static inline int crypto_ahash_update(struct ahash_request *req) 547 - { 548 - struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 549 - struct hash_alg_common *alg = crypto_hash_alg_common(tfm); 550 - 551 - if (IS_ENABLED(CONFIG_CRYPTO_STATS)) 552 - atomic64_add(req->nbytes, &hash_get_stat(alg)->hash_tlen); 553 - 554 - return crypto_hash_errstat(alg, tfm->update(req)); 555 - } 595 + int crypto_ahash_update(struct ahash_request *req); 556 596 557 597 /** 558 598 * DOC: Asynchronous Hash Request Handle