crypto: shash - Make descsize a run-time attribute

This patch changes descsize to a run-time attribute so that
implementations can change it in their init functions.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Herbert Xu
2009-07-14 12:50:12 +08:00
parent aef73cfcb9
commit 113adefc73
3 changed files with 31 additions and 13 deletions
+2 -1
View File
@@ -48,6 +48,7 @@ struct crypto_ahash {
};
struct crypto_shash {
unsigned int descsize;
struct crypto_tfm base;
};
@@ -275,7 +276,7 @@ static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags)
static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm)
{
return crypto_shash_alg(tfm)->descsize;
return tfm->descsize;
}
static inline void *shash_desc_ctx(struct shash_desc *desc)
+1 -1
View File
@@ -135,7 +135,7 @@ static inline void *crypto_shash_ctx_aligned(struct crypto_shash *tfm)
static inline struct crypto_shash *__crypto_shash_cast(struct crypto_tfm *tfm)
{
return (struct crypto_shash *)tfm;
return container_of(tfm, struct crypto_shash, base);
}
#endif /* _CRYPTO_INTERNAL_HASH_H */