diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2025-05-04 16:33:21 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-05-05 13:20:46 +0300 |
commit | 1052671ca118b79fa3f5de281bba850aaf20bbf5 (patch) | |
tree | 10a3f0de9902c7eb1b2d16c8b4956f3c79bc2bc0 /include/crypto | |
parent | fd66f2ab09b8305006764887cc47eeeb1ca5704b (diff) | |
download | linux-1052671ca118b79fa3f5de281bba850aaf20bbf5.tar.xz |
crypto: ahash - Add core export and import
Add crypto_ahash_export_core and crypto_ahash_import_core. For
now they only differ from the normal export/import functions when
going through shash.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/hash.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h index e0321b5ec363..1760662ad70a 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h @@ -507,6 +507,18 @@ int crypto_ahash_digest(struct ahash_request *req); int crypto_ahash_export(struct ahash_request *req, void *out); /** + * crypto_ahash_export_core() - extract core state for message digest + * @req: reference to the ahash_request handle whose state is exported + * @out: output buffer of sufficient size that can hold the hash state + * + * Export the hash state without the partial block buffer. + * + * Context: Softirq or process context. + * Return: 0 if the export creation was successful; < 0 if an error occurred + */ +int crypto_ahash_export_core(struct ahash_request *req, void *out); + +/** * crypto_ahash_import() - import message digest state * @req: reference to ahash_request handle the state is imported into * @in: buffer holding the state @@ -520,6 +532,18 @@ int crypto_ahash_export(struct ahash_request *req, void *out); int crypto_ahash_import(struct ahash_request *req, const void *in); /** + * crypto_ahash_import_core() - import core state + * @req: reference to ahash_request handle the state is imported into + * @in: buffer holding the state + * + * Import the hash state without the partial block buffer. + * + * Context: Softirq or process context. + * Return: 0 if the import was successful; < 0 if an error occurred + */ +int crypto_ahash_import_core(struct ahash_request *req, const void *in); + +/** * crypto_ahash_init() - (re)initialize message digest handle * @req: ahash_request handle that already is initialized with all necessary * data using the ahash_request_* API functions |