13 #ifndef _CRYPTO_HASH_H
14 #define _CRYPTO_HASH_H
78 unsigned int digestsize
118 static inline void crypto_free_ahash(
struct crypto_ahash *tfm)
123 static inline unsigned int crypto_ahash_alignmask(
126 return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm));
138 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg);
141 static inline unsigned int crypto_ahash_digestsize(
struct crypto_ahash *tfm)
143 return crypto_hash_alg_common(tfm)->digestsize;
146 static inline unsigned int crypto_ahash_statesize(
struct crypto_ahash *tfm)
148 return crypto_hash_alg_common(tfm)->statesize;
153 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm));
158 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags);
161 static inline void crypto_ahash_clear_flags(
struct crypto_ahash *tfm,
u32 flags)
163 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags);
169 return __crypto_ahash_cast(req->
base.tfm);
172 static inline unsigned int crypto_ahash_reqsize(
struct crypto_ahash *tfm)
183 unsigned int keylen);
190 return crypto_ahash_reqtfm(req)->export(req, out);
193 static inline int crypto_ahash_import(
struct ahash_request *req,
const void *
in)
195 return crypto_ahash_reqtfm(req)->import(req, in);
198 static inline int crypto_ahash_init(
struct ahash_request *req)
200 return crypto_ahash_reqtfm(req)->init(req);
203 static inline int crypto_ahash_update(
struct ahash_request *req)
205 return crypto_ahash_reqtfm(req)->update(req);
208 static inline void ahash_request_set_tfm(
struct ahash_request *req,
211 req->
base.tfm = crypto_ahash_tfm(tfm);
220 crypto_ahash_reqsize(tfm), gfp);
223 ahash_request_set_tfm(req, tfm);
228 static inline void ahash_request_free(
struct ahash_request *req)
239 static inline void ahash_request_set_callback(
struct ahash_request *req,
249 static inline void ahash_request_set_crypt(
struct ahash_request *req,
266 static inline void crypto_free_shash(
struct crypto_shash *tfm)
271 static inline unsigned int crypto_shash_alignmask(
274 return crypto_tfm_alg_alignmask(crypto_shash_tfm(tfm));
277 static inline unsigned int crypto_shash_blocksize(
struct crypto_shash *tfm)
279 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm));
289 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg);
292 static inline unsigned int crypto_shash_digestsize(
struct crypto_shash *tfm)
294 return crypto_shash_alg(tfm)->digestsize;
297 static inline unsigned int crypto_shash_statesize(
struct crypto_shash *tfm)
299 return crypto_shash_alg(tfm)->statesize;
304 return crypto_tfm_get_flags(crypto_shash_tfm(tfm));
307 static inline void crypto_shash_set_flags(
struct crypto_shash *tfm,
u32 flags)
309 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags);
312 static inline void crypto_shash_clear_flags(
struct crypto_shash *tfm,
u32 flags)
314 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags);
317 static inline unsigned int crypto_shash_descsize(
struct crypto_shash *tfm)
328 unsigned int keylen);
330 unsigned int len,
u8 *out);
332 static inline int crypto_shash_export(
struct shash_desc *
desc,
void *out)
334 return crypto_shash_alg(desc->
tfm)->export(desc, out);
337 static inline int crypto_shash_import(
struct shash_desc *desc,
const void *in)
339 return crypto_shash_alg(desc->
tfm)->import(desc, in);
342 static inline int crypto_shash_init(
struct shash_desc *desc)
344 return crypto_shash_alg(desc->
tfm)->init(desc);
351 unsigned int len,
u8 *out);