Skip to content

Commit 379d972

Browse files
vwaxherbertx
authored andcommitted
crypto: doc - Fix hash export state information
The documentation states that crypto_ahash_reqsize() provides the size of the state structure used by crypto_ahash_export(). But it's actually crypto_ahash_statesize() which provides this size. Signed-off-by: Rabin Vincent <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 34cb582 commit 379d972

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Documentation/crypto/api-digest.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Asynchronous Message Digest API
1414
:doc: Asynchronous Message Digest API
1515

1616
.. kernel-doc:: include/crypto/hash.h
17-
:functions: crypto_alloc_ahash crypto_free_ahash crypto_ahash_init crypto_ahash_digestsize crypto_ahash_reqtfm crypto_ahash_reqsize crypto_ahash_setkey crypto_ahash_finup crypto_ahash_final crypto_ahash_digest crypto_ahash_export crypto_ahash_import
17+
:functions: crypto_alloc_ahash crypto_free_ahash crypto_ahash_init crypto_ahash_digestsize crypto_ahash_reqtfm crypto_ahash_reqsize crypto_ahash_statesize crypto_ahash_setkey crypto_ahash_finup crypto_ahash_final crypto_ahash_digest crypto_ahash_export crypto_ahash_import
1818

1919
Asynchronous Hash Request Handle
2020
--------------------------------

include/crypto/hash.h

+12-6
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,16 @@ static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm)
329329
return crypto_hash_alg_common(tfm)->digestsize;
330330
}
331331

332+
/**
333+
* crypto_ahash_statesize() - obtain size of the ahash state
334+
* @tfm: cipher handle
335+
*
336+
* Return the size of the ahash state. With the crypto_ahash_export()
337+
* function, the caller can export the state into a buffer whose size is
338+
* defined with this function.
339+
*
340+
* Return: size of the ahash state
341+
*/
332342
static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm)
333343
{
334344
return crypto_hash_alg_common(tfm)->statesize;
@@ -369,11 +379,7 @@ static inline struct crypto_ahash *crypto_ahash_reqtfm(
369379
* crypto_ahash_reqsize() - obtain size of the request data structure
370380
* @tfm: cipher handle
371381
*
372-
* Return the size of the ahash state size. With the crypto_ahash_export
373-
* function, the caller can export the state into a buffer whose size is
374-
* defined with this function.
375-
*
376-
* Return: size of the ahash state
382+
* Return: size of the request data
377383
*/
378384
static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm)
379385
{
@@ -453,7 +459,7 @@ int crypto_ahash_digest(struct ahash_request *req);
453459
*
454460
* This function exports the hash state of the ahash_request handle into the
455461
* caller-allocated output buffer out which must have sufficient size (e.g. by
456-
* calling crypto_ahash_reqsize).
462+
* calling crypto_ahash_statesize()).
457463
*
458464
* Return: 0 if the export was successful; < 0 if an error occurred
459465
*/

0 commit comments

Comments
 (0)