Lines Matching refs:tfm
142 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
144 int (*init_tfm)(struct crypto_ahash *tfm);
145 void (*exit_tfm)(struct crypto_ahash *tfm);
151 struct crypto_shash *tfm; member
209 int (*setkey)(struct crypto_shash *tfm, const u8 *key,
211 int (*init_tfm)(struct crypto_shash *tfm);
212 void (*exit_tfm)(struct crypto_shash *tfm);
232 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
254 static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm) in __crypto_ahash_cast() argument
256 return container_of(tfm, struct crypto_ahash, base); in __crypto_ahash_cast()
276 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm) in crypto_ahash_tfm() argument
278 return &tfm->base; in crypto_ahash_tfm()
285 static inline void crypto_free_ahash(struct crypto_ahash *tfm) in crypto_free_ahash() argument
287 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm)); in crypto_free_ahash()
302 static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm) in crypto_ahash_alg_name() argument
304 return crypto_tfm_alg_name(crypto_ahash_tfm(tfm)); in crypto_ahash_alg_name()
307 static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm) in crypto_ahash_driver_name() argument
309 return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm)); in crypto_ahash_driver_name()
313 struct crypto_ahash *tfm) in crypto_ahash_alignmask() argument
315 return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm)); in crypto_ahash_alignmask()
327 static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm) in crypto_ahash_blocksize() argument
329 return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in crypto_ahash_blocksize()
339 struct crypto_ahash *tfm) in crypto_hash_alg_common() argument
341 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg); in crypto_hash_alg_common()
354 static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm) in crypto_ahash_digestsize() argument
356 return crypto_hash_alg_common(tfm)->digestsize; in crypto_ahash_digestsize()
369 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm) in crypto_ahash_statesize() argument
371 return crypto_hash_alg_common(tfm)->statesize; in crypto_ahash_statesize()
374 static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm) in crypto_ahash_get_flags() argument
376 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm)); in crypto_ahash_get_flags()
379 static inline void crypto_ahash_set_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_set_flags() argument
381 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_set_flags()
384 static inline void crypto_ahash_clear_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_clear_flags() argument
386 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_clear_flags()
402 return __crypto_ahash_cast(req->base.tfm); in crypto_ahash_reqtfm()
411 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm) in crypto_ahash_reqsize() argument
413 return tfm->reqsize; in crypto_ahash_reqsize()
432 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
507 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_import() local
509 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_import()
512 return tfm->import(req, in); in crypto_ahash_import()
528 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_init() local
530 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_init()
533 return tfm->init(req); in crypto_ahash_init()
549 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_update() local
550 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_update()
580 struct crypto_ahash *tfm) in ahash_request_set_tfm() argument
582 req->base.tfm = crypto_ahash_tfm(tfm); in ahash_request_set_tfm()
598 struct crypto_ahash *tfm, gfp_t gfp) in ahash_request_alloc() argument
603 crypto_ahash_reqsize(tfm), gfp); in ahash_request_alloc()
606 ahash_request_set_tfm(req, tfm); in ahash_request_alloc()
719 static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm) in crypto_shash_tfm() argument
721 return &tfm->base; in crypto_shash_tfm()
728 static inline void crypto_free_shash(struct crypto_shash *tfm) in crypto_free_shash() argument
730 crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm)); in crypto_free_shash()
733 static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm) in crypto_shash_alg_name() argument
735 return crypto_tfm_alg_name(crypto_shash_tfm(tfm)); in crypto_shash_alg_name()
738 static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm) in crypto_shash_driver_name() argument
740 return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm)); in crypto_shash_driver_name()
744 struct crypto_shash *tfm) in crypto_shash_alignmask() argument
746 return crypto_tfm_alg_alignmask(crypto_shash_tfm(tfm)); in crypto_shash_alignmask()
758 static inline unsigned int crypto_shash_blocksize(struct crypto_shash *tfm) in crypto_shash_blocksize() argument
760 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm)); in crypto_shash_blocksize()
768 static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm) in crypto_shash_alg() argument
770 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg); in crypto_shash_alg()
782 static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm) in crypto_shash_digestsize() argument
784 return crypto_shash_alg(tfm)->digestsize; in crypto_shash_digestsize()
787 static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm) in crypto_shash_statesize() argument
789 return crypto_shash_alg(tfm)->statesize; in crypto_shash_statesize()
792 static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm) in crypto_shash_get_flags() argument
794 return crypto_tfm_get_flags(crypto_shash_tfm(tfm)); in crypto_shash_get_flags()
797 static inline void crypto_shash_set_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_set_flags() argument
799 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_set_flags()
802 static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_clear_flags() argument
804 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_clear_flags()
822 static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm) in crypto_shash_descsize() argument
824 return tfm->descsize; in crypto_shash_descsize()
845 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
882 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data,
899 return crypto_shash_alg(desc->tfm)->export(desc, out); in crypto_shash_export()
916 struct crypto_shash *tfm = desc->tfm; in crypto_shash_import() local
918 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_import()
921 return crypto_shash_alg(tfm)->import(desc, in); in crypto_shash_import()
938 struct crypto_shash *tfm = desc->tfm; in crypto_shash_init() local
940 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_init()
943 return crypto_shash_alg(tfm)->init(desc); in crypto_shash_init()
998 sizeof(*desc) + crypto_shash_descsize(desc->tfm)); in shash_desc_zero()