]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
crypto: ahash - Add crypto_ahash_blocksize
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 19 Oct 2015 01:37:41 +0000 (09:37 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 20 Oct 2015 14:10:48 +0000 (22:10 +0800)
This patch adds the missing helper crypto_ahash_blocksize which
returns the block size of an ahash algorithm.

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

index 8e920b44c0ac4b14238ef0877812fab4eaf7f8b8..3d69c93d50e83d7b804f9de7260007ffc9903d69 100644 (file)
@@ -264,6 +264,20 @@ static inline unsigned int crypto_ahash_alignmask(
        return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm));
 }
 
+/**
+ * crypto_ahash_blocksize() - obtain block size for cipher
+ * @tfm: cipher handle
+ *
+ * The block size for the message digest cipher referenced with the cipher
+ * handle is returned.
+ *
+ * Return: block size of cipher
+ */
+static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm)
+{
+       return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm));
+}
+
 static inline struct hash_alg_common *__crypto_hash_alg_common(
        struct crypto_alg *alg)
 {