diff options
| author | Rabin Vincent <rabinv@axis.com> | 2017-01-26 10:33:00 -0500 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-02-03 05:16:11 -0500 |
| commit | 379d972b81151b811ab769db5ab8da9c71bbfb00 (patch) | |
| tree | a7d06c3ee62729cd191f76e22179b07707e1aadb /include/crypto | |
| parent | 34cb58213948a0c26a228da903a3b37c2505843c (diff) | |
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 <rabinv@axis.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
| -rw-r--r-- | include/crypto/hash.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h index 216a2b876147..b5727bcd2336 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h | |||
| @@ -329,6 +329,16 @@ static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm) | |||
| 329 | return crypto_hash_alg_common(tfm)->digestsize; | 329 | return crypto_hash_alg_common(tfm)->digestsize; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 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 | */ | ||
| 332 | static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm) | 342 | static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm) |
| 333 | { | 343 | { |
| 334 | return crypto_hash_alg_common(tfm)->statesize; | 344 | return crypto_hash_alg_common(tfm)->statesize; |
| @@ -369,11 +379,7 @@ static inline struct crypto_ahash *crypto_ahash_reqtfm( | |||
| 369 | * crypto_ahash_reqsize() - obtain size of the request data structure | 379 | * crypto_ahash_reqsize() - obtain size of the request data structure |
| 370 | * @tfm: cipher handle | 380 | * @tfm: cipher handle |
| 371 | * | 381 | * |
| 372 | * Return the size of the ahash state size. With the crypto_ahash_export | 382 | * Return: size of the request data |
| 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 | ||
| 377 | */ | 383 | */ |
| 378 | static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm) | 384 | static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm) |
| 379 | { | 385 | { |
| @@ -453,7 +459,7 @@ int crypto_ahash_digest(struct ahash_request *req); | |||
| 453 | * | 459 | * |
| 454 | * This function exports the hash state of the ahash_request handle into the | 460 | * This function exports the hash state of the ahash_request handle into the |
| 455 | * caller-allocated output buffer out which must have sufficient size (e.g. by | 461 | * caller-allocated output buffer out which must have sufficient size (e.g. by |
| 456 | * calling crypto_ahash_reqsize). | 462 | * calling crypto_ahash_statesize()). |
| 457 | * | 463 | * |
| 458 | * Return: 0 if the export was successful; < 0 if an error occurred | 464 | * Return: 0 if the export was successful; < 0 if an error occurred |
| 459 | */ | 465 | */ |
