-
-static inline int crypto_hash_update(struct hash_desc *desc,
- struct scatterlist *sg,
- unsigned int nbytes)
-{
- if (desc->tfm->crt_digest.dit_update == NULL)
- return -1;
-
- LASSERT(nbytes == sg->length);
- crypto_digest_update(desc->tfm, sg, 1);
-
- return 0;
-}
-
-static inline int crypto_hash_digest(struct hash_desc *desc,
- struct scatterlist *sg,
- unsigned int nbytes, unsigned char *out)
-{
- crypto_hash_update(desc, sg, nbytes);
- crypto_digest_final(desc->tfm, out);
- return 0;
-}
-
-static inline int crypto_hash_final(struct hash_desc *desc, unsigned char *out)
-{
- crypto_digest_final(desc->tfm, out);
- return 0;
-}
-
-static inline struct crypto_tfm *crypto_hash_tfm(struct crypto_hash *tfm)
-{
- return tfm;
-}
-
-#define crypto_hash_setkey(tfm, key, keylen) \
- crypto_digest_setkey(tfm, key, keylen)
-#define crypto_hash_digestsize(tfm) crypto_tfm_alg_digestsize(tfm)
-#define crypto_hash_blocksize(tfm) crypto_tfm_alg_blocksize(tfm)