Lines Matching refs:tfm

141 	int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
148 struct crypto_shash *tfm; member
187 int (*setkey)(struct crypto_shash *tfm, const u8 *key,
208 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
230 static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm) in __crypto_ahash_cast() argument
232 return container_of(tfm, struct crypto_ahash, base); in __crypto_ahash_cast()
252 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm) in crypto_ahash_tfm() argument
254 return &tfm->base; in crypto_ahash_tfm()
261 static inline void crypto_free_ahash(struct crypto_ahash *tfm) in crypto_free_ahash() argument
263 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm)); in crypto_free_ahash()
278 static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm) in crypto_ahash_alg_name() argument
280 return crypto_tfm_alg_name(crypto_ahash_tfm(tfm)); in crypto_ahash_alg_name()
283 static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm) in crypto_ahash_driver_name() argument
285 return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm)); in crypto_ahash_driver_name()
289 struct crypto_ahash *tfm) in crypto_ahash_alignmask() argument
291 return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm)); in crypto_ahash_alignmask()
303 static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm) in crypto_ahash_blocksize() argument
305 return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in crypto_ahash_blocksize()
315 struct crypto_ahash *tfm) in crypto_hash_alg_common() argument
317 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg); in crypto_hash_alg_common()
330 static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm) in crypto_ahash_digestsize() argument
332 return crypto_hash_alg_common(tfm)->digestsize; in crypto_ahash_digestsize()
345 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm) in crypto_ahash_statesize() argument
347 return crypto_hash_alg_common(tfm)->statesize; in crypto_ahash_statesize()
350 static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm) in crypto_ahash_get_flags() argument
352 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm)); in crypto_ahash_get_flags()
355 static inline void crypto_ahash_set_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_set_flags() argument
357 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_set_flags()
360 static inline void crypto_ahash_clear_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_clear_flags() argument
362 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_clear_flags()
378 return __crypto_ahash_cast(req->base.tfm); in crypto_ahash_reqtfm()
387 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm) in crypto_ahash_reqsize() argument
389 return tfm->reqsize; in crypto_ahash_reqsize()
408 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
483 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_import() local
485 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_import()
488 return tfm->import(req, in); in crypto_ahash_import()
504 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_init() local
506 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_init()
509 return tfm->init(req); in crypto_ahash_init()
548 struct crypto_ahash *tfm) in ahash_request_set_tfm() argument
550 req->base.tfm = crypto_ahash_tfm(tfm); in ahash_request_set_tfm()
566 struct crypto_ahash *tfm, gfp_t gfp) in ahash_request_alloc() argument
571 crypto_ahash_reqsize(tfm), gfp); in ahash_request_alloc()
574 ahash_request_set_tfm(req, tfm); in ahash_request_alloc()
687 static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm) in crypto_shash_tfm() argument
689 return &tfm->base; in crypto_shash_tfm()
696 static inline void crypto_free_shash(struct crypto_shash *tfm) in crypto_free_shash() argument
698 crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm)); in crypto_free_shash()
701 static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm) in crypto_shash_alg_name() argument
703 return crypto_tfm_alg_name(crypto_shash_tfm(tfm)); in crypto_shash_alg_name()
706 static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm) in crypto_shash_driver_name() argument
708 return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm)); in crypto_shash_driver_name()
712 struct crypto_shash *tfm) in crypto_shash_alignmask() argument
714 return crypto_tfm_alg_alignmask(crypto_shash_tfm(tfm)); in crypto_shash_alignmask()
726 static inline unsigned int crypto_shash_blocksize(struct crypto_shash *tfm) in crypto_shash_blocksize() argument
728 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm)); in crypto_shash_blocksize()
736 static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm) in crypto_shash_alg() argument
738 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg); in crypto_shash_alg()
750 static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm) in crypto_shash_digestsize() argument
752 return crypto_shash_alg(tfm)->digestsize; in crypto_shash_digestsize()
755 static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm) in crypto_shash_statesize() argument
757 return crypto_shash_alg(tfm)->statesize; in crypto_shash_statesize()
760 static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm) in crypto_shash_get_flags() argument
762 return crypto_tfm_get_flags(crypto_shash_tfm(tfm)); in crypto_shash_get_flags()
765 static inline void crypto_shash_set_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_set_flags() argument
767 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_set_flags()
770 static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_clear_flags() argument
772 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_clear_flags()
790 static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm) in crypto_shash_descsize() argument
792 return tfm->descsize; in crypto_shash_descsize()
812 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
845 return crypto_shash_alg(desc->tfm)->export(desc, out); in crypto_shash_export()
861 struct crypto_shash *tfm = desc->tfm; in crypto_shash_import() local
863 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_import()
866 return crypto_shash_alg(tfm)->import(desc, in); in crypto_shash_import()
882 struct crypto_shash *tfm = desc->tfm; in crypto_shash_init() local
884 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_init()
887 return crypto_shash_alg(tfm)->init(desc); in crypto_shash_init()
939 sizeof(*desc) + crypto_shash_descsize(desc->tfm)); in shash_desc_zero()