]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: hash - Add HASH_REQUEST_ON_STACK
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 12 Apr 2025 10:57:19 +0000 (18:57 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 16 Apr 2025 07:36:24 +0000 (15:36 +0800)
commit04bfa4c7d5119ca38f8133bfdae7957a60c8b221
tree70c6700d83b01fdd8f40f017cc5d7f126d88ef8c
parent90916934fd093edf62bc0c5c9a940a8efa7db2f8
crypto: hash - Add HASH_REQUEST_ON_STACK

Allow any ahash to be used with a stack request, with optional
dynamic allocation when async is needed.  The intended usage is:

HASH_REQUEST_ON_STACK(req, tfm);

...
err = crypto_ahash_digest(req);
/* The request cannot complete synchronously. */
if (err == -EAGAIN) {
/* This will not fail. */
req = HASH_REQUEST_CLONE(req, gfp);

/* Redo operation. */
err = crypto_ahash_digest(req);
}

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ahash.c
include/crypto/hash.h
include/crypto/internal/hash.h