Lines Matching refs:tfm
136 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
143 struct crypto_shash *tfm; member
190 int (*setkey)(struct crypto_shash *tfm, const u8 *key,
211 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
233 static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm) in __crypto_ahash_cast() argument
235 return container_of(tfm, struct crypto_ahash, base); in __crypto_ahash_cast()
255 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm) in crypto_ahash_tfm() argument
257 return &tfm->base; in crypto_ahash_tfm()
266 static inline void crypto_free_ahash(struct crypto_ahash *tfm) in crypto_free_ahash() argument
268 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm)); in crypto_free_ahash()
283 static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm) in crypto_ahash_alg_name() argument
285 return crypto_tfm_alg_name(crypto_ahash_tfm(tfm)); in crypto_ahash_alg_name()
288 static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm) in crypto_ahash_driver_name() argument
290 return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm)); in crypto_ahash_driver_name()
294 struct crypto_ahash *tfm) in crypto_ahash_alignmask() argument
296 return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm)); in crypto_ahash_alignmask()
308 static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm) in crypto_ahash_blocksize() argument
310 return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in crypto_ahash_blocksize()
320 struct crypto_ahash *tfm) in crypto_hash_alg_common() argument
322 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg); in crypto_hash_alg_common()
335 static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm) in crypto_ahash_digestsize() argument
337 return crypto_hash_alg_common(tfm)->digestsize; in crypto_ahash_digestsize()
350 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm) in crypto_ahash_statesize() argument
352 return crypto_hash_alg_common(tfm)->statesize; in crypto_ahash_statesize()
355 static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm) in crypto_ahash_get_flags() argument
357 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm)); in crypto_ahash_get_flags()
360 static inline void crypto_ahash_set_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_set_flags() argument
362 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_set_flags()
365 static inline void crypto_ahash_clear_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_clear_flags() argument
367 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_clear_flags()
383 return __crypto_ahash_cast(req->base.tfm); in crypto_ahash_reqtfm()
392 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm) in crypto_ahash_reqsize() argument
394 return tfm->reqsize; in crypto_ahash_reqsize()
413 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
488 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_import() local
490 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_import()
493 return tfm->import(req, in); in crypto_ahash_import()
509 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_init() local
511 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_init()
514 return tfm->init(req); in crypto_ahash_init()
530 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_update() local
531 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_update()
561 struct crypto_ahash *tfm) in ahash_request_set_tfm() argument
563 req->base.tfm = crypto_ahash_tfm(tfm); in ahash_request_set_tfm()
579 struct crypto_ahash *tfm, gfp_t gfp) in ahash_request_alloc() argument
584 crypto_ahash_reqsize(tfm), gfp); in ahash_request_alloc()
587 ahash_request_set_tfm(req, tfm); in ahash_request_alloc()
700 static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm) in crypto_shash_tfm() argument
702 return &tfm->base; in crypto_shash_tfm()
711 static inline void crypto_free_shash(struct crypto_shash *tfm) in crypto_free_shash() argument
713 crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm)); in crypto_free_shash()
716 static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm) in crypto_shash_alg_name() argument
718 return crypto_tfm_alg_name(crypto_shash_tfm(tfm)); in crypto_shash_alg_name()
721 static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm) in crypto_shash_driver_name() argument
723 return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm)); in crypto_shash_driver_name()
727 struct crypto_shash *tfm) in crypto_shash_alignmask() argument
729 return crypto_tfm_alg_alignmask(crypto_shash_tfm(tfm)); in crypto_shash_alignmask()
741 static inline unsigned int crypto_shash_blocksize(struct crypto_shash *tfm) in crypto_shash_blocksize() argument
743 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm)); in crypto_shash_blocksize()
751 static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm) in crypto_shash_alg() argument
753 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg); in crypto_shash_alg()
765 static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm) in crypto_shash_digestsize() argument
767 return crypto_shash_alg(tfm)->digestsize; in crypto_shash_digestsize()
770 static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm) in crypto_shash_statesize() argument
772 return crypto_shash_alg(tfm)->statesize; in crypto_shash_statesize()
775 static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm) in crypto_shash_get_flags() argument
777 return crypto_tfm_get_flags(crypto_shash_tfm(tfm)); in crypto_shash_get_flags()
780 static inline void crypto_shash_set_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_set_flags() argument
782 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_set_flags()
785 static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_clear_flags() argument
787 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_clear_flags()
805 static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm) in crypto_shash_descsize() argument
807 return tfm->descsize; in crypto_shash_descsize()
828 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
863 return crypto_shash_alg(desc->tfm)->export(desc, out); in crypto_shash_export()
880 struct crypto_shash *tfm = desc->tfm; in crypto_shash_import() local
882 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_import()
885 return crypto_shash_alg(tfm)->import(desc, in); in crypto_shash_import()
902 struct crypto_shash *tfm = desc->tfm; in crypto_shash_init() local
904 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_init()
907 return crypto_shash_alg(tfm)->init(desc); in crypto_shash_init()
962 sizeof(*desc) + crypto_shash_descsize(desc->tfm)); in shash_desc_zero()