aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/crypto/hash.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-04-20 18:05:16 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-05-12 18:48:01 +0800
commitc7535fb2ddf695fbb8b2c2b935307e33556082de (patch)
tree1cd9d1ad6f646664da155aae77498cb6c05676e2 /include/crypto/hash.h
parentcrypto: ixp4xx - silence uninitialized variable warning (diff)
downloadwireguard-linux-c7535fb2ddf695fbb8b2c2b935307e33556082de.tar.xz
wireguard-linux-c7535fb2ddf695fbb8b2c2b935307e33556082de.zip
crypto: hash - Add statesize to crypto_ahash
As ahash drivers may need to use fallbacks, their state size is thus variable. Deal with this by making it an attribute of crypto_ahash. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/hash.h')
-rw-r--r--include/crypto/hash.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index e69542d86a2b..f7c2a22cd776 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -260,6 +260,7 @@ struct crypto_ahash {
int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen);
+ unsigned int statesize;
unsigned int reqsize;
struct crypto_tfm base;
};
@@ -400,7 +401,7 @@ static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm)
*/
static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm)
{
- return crypto_hash_alg_common(tfm)->statesize;
+ return tfm->statesize;
}
static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm)