linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: doc - Fix hash export state information
@ 2017-01-25 15:55 Rabin Vincent
  2017-01-25 16:18 ` Stephan Müller
  0 siblings, 1 reply; 3+ messages in thread
From: Rabin Vincent @ 2017-01-25 15:55 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, smueller, Rabin Vincent

From: Rabin Vincent <rabinv@axis.com>

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>
---
 include/crypto/hash.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index 216a2b8..26ebbbc 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)
 	return crypto_hash_alg_common(tfm)->digestsize;
 }
 
+/**
+ * crypto_ahash_statesize() - obtain size of the ahash state
+ * @tfm: cipher handle
+ *
+ * Return the size of the ahash state. With the crypto_ahash_export
+ * function, the caller can export the state into a buffer whose size is
+ * defined with this function.
+ *
+ * Return: size of the ahash state
+ */
 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm)
 {
 	return crypto_hash_alg_common(tfm)->statesize;
@@ -365,16 +375,6 @@ static inline struct crypto_ahash *crypto_ahash_reqtfm(
 	return __crypto_ahash_cast(req->base.tfm);
 }
 
-/**
- * crypto_ahash_reqsize() - obtain size of the request data structure
- * @tfm: cipher handle
- *
- * Return the size of the ahash state size. With the crypto_ahash_export
- * function, the caller can export the state into a buffer whose size is
- * defined with this function.
- *
- * Return: size of the ahash state
- */
 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm)
 {
 	return tfm->reqsize;
@@ -453,7 +453,7 @@ int crypto_ahash_digest(struct ahash_request *req);
  *
  * This function exports the hash state of the ahash_request handle into the
  * caller-allocated output buffer out which must have sufficient size (e.g. by
- * calling crypto_ahash_reqsize).
+ * calling crypto_ahash_statesize).
  *
  * Return: 0 if the export was successful; < 0 if an error occurred
  */
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: doc - Fix hash export state information
  2017-01-25 15:55 [PATCH] crypto: doc - Fix hash export state information Rabin Vincent
@ 2017-01-25 16:18 ` Stephan Müller
  2017-01-26 15:33   ` Rabin Vincent
  0 siblings, 1 reply; 3+ messages in thread
From: Stephan Müller @ 2017-01-25 16:18 UTC (permalink / raw)
  To: Rabin Vincent; +Cc: herbert, linux-crypto, Rabin Vincent

Am Mittwoch, 25. Januar 2017, 16:55:06 CET schrieb Rabin Vincent:

Hi Rabin,

> From: Rabin Vincent <rabinv@axis.com>
> 
> 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.

ack for the statesize documentation addition.

In addition, can you please add crypto_ahash_statesize to Documentation/
crypto/api-digest.rst.

nack - The documentation is quite right for reqsize: it returns the *request 
data structure* size as documented.

Ciao
Stephan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: doc - Fix hash export state information
  2017-01-25 16:18 ` Stephan Müller
@ 2017-01-26 15:33   ` Rabin Vincent
  0 siblings, 0 replies; 3+ messages in thread
From: Rabin Vincent @ 2017-01-26 15:33 UTC (permalink / raw)
  To: Stephan Müller; +Cc: herbert, linux-crypto

On Wed, Jan 25, 2017 at 05:18:05PM +0100, Stephan Müller wrote:
> Am Mittwoch, 25. Januar 2017, 16:55:06 CET schrieb Rabin Vincent:
> > 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.
> 
> ack for the statesize documentation addition.
> 
> In addition, can you please add crypto_ahash_statesize to Documentation/
> crypto/api-digest.rst.

OK.

> nack - The documentation is quite right for reqsize: it returns the *request 
> data structure* size as documented.

It's only that one line which is correct, the rest of the documentation
talked about the state size.  I'll add back that one line, since similar
functions like crypto_aead_reqsize() have it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-26 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25 15:55 [PATCH] crypto: doc - Fix hash export state information Rabin Vincent
2017-01-25 16:18 ` Stephan Müller
2017-01-26 15:33   ` Rabin Vincent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).