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()
287 static inline void crypto_free_ahash(struct crypto_ahash *tfm) in crypto_free_ahash() argument
289 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm)); in crypto_free_ahash()
304 static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm) in crypto_ahash_alg_name() argument
306 return crypto_tfm_alg_name(crypto_ahash_tfm(tfm)); in crypto_ahash_alg_name()
309 static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm) in crypto_ahash_driver_name() argument
311 return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm)); in crypto_ahash_driver_name()
315 struct crypto_ahash *tfm) in crypto_ahash_alignmask() argument
317 return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm)); in crypto_ahash_alignmask()
329 static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm) in crypto_ahash_blocksize() argument
331 return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in crypto_ahash_blocksize()
341 struct crypto_ahash *tfm) in crypto_hash_alg_common() argument
343 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg); in crypto_hash_alg_common()
356 static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm) in crypto_ahash_digestsize() argument
358 return crypto_hash_alg_common(tfm)->digestsize; in crypto_ahash_digestsize()
371 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm) in crypto_ahash_statesize() argument
373 return crypto_hash_alg_common(tfm)->statesize; in crypto_ahash_statesize()
376 static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm) in crypto_ahash_get_flags() argument
378 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm)); in crypto_ahash_get_flags()
381 static inline void crypto_ahash_set_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_set_flags() argument
383 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_set_flags()
386 static inline void crypto_ahash_clear_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_clear_flags() argument
388 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_clear_flags()
404 return __crypto_ahash_cast(req->base.tfm); in crypto_ahash_reqtfm()
413 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm) in crypto_ahash_reqsize() argument
415 return tfm->reqsize; in crypto_ahash_reqsize()
434 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
509 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_import() local
511 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_import()
514 return tfm->import(req, in); in crypto_ahash_import()
530 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_init() local
532 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_init()
535 return tfm->init(req); in crypto_ahash_init()
551 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_update() local
552 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_update()
582 struct crypto_ahash *tfm) in ahash_request_set_tfm() argument
584 req->base.tfm = crypto_ahash_tfm(tfm); in ahash_request_set_tfm()
600 struct crypto_ahash *tfm, gfp_t gfp) in ahash_request_alloc() argument
605 crypto_ahash_reqsize(tfm), gfp); in ahash_request_alloc()
608 ahash_request_set_tfm(req, tfm); in ahash_request_alloc()
721 static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm) in crypto_shash_tfm() argument
723 return &tfm->base; in crypto_shash_tfm()
732 static inline void crypto_free_shash(struct crypto_shash *tfm) in crypto_free_shash() argument
734 crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm)); in crypto_free_shash()
737 static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm) in crypto_shash_alg_name() argument
739 return crypto_tfm_alg_name(crypto_shash_tfm(tfm)); in crypto_shash_alg_name()
742 static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm) in crypto_shash_driver_name() argument
744 return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm)); in crypto_shash_driver_name()
748 struct crypto_shash *tfm) in crypto_shash_alignmask() argument
750 return crypto_tfm_alg_alignmask(crypto_shash_tfm(tfm)); in crypto_shash_alignmask()
762 static inline unsigned int crypto_shash_blocksize(struct crypto_shash *tfm) in crypto_shash_blocksize() argument
764 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm)); in crypto_shash_blocksize()
772 static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm) in crypto_shash_alg() argument
774 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg); in crypto_shash_alg()
786 static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm) in crypto_shash_digestsize() argument
788 return crypto_shash_alg(tfm)->digestsize; in crypto_shash_digestsize()
791 static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm) in crypto_shash_statesize() argument
793 return crypto_shash_alg(tfm)->statesize; in crypto_shash_statesize()
796 static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm) in crypto_shash_get_flags() argument
798 return crypto_tfm_get_flags(crypto_shash_tfm(tfm)); in crypto_shash_get_flags()
801 static inline void crypto_shash_set_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_set_flags() argument
803 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_set_flags()
806 static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_clear_flags() argument
808 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_clear_flags()
826 static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm) in crypto_shash_descsize() argument
828 return tfm->descsize; in crypto_shash_descsize()
849 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
886 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data,
903 return crypto_shash_alg(desc->tfm)->export(desc, out); in crypto_shash_export()
920 struct crypto_shash *tfm = desc->tfm; in crypto_shash_import() local
922 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_import()
925 return crypto_shash_alg(tfm)->import(desc, in); in crypto_shash_import()
942 struct crypto_shash *tfm = desc->tfm; in crypto_shash_init() local
944 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_init()
947 return crypto_shash_alg(tfm)->init(desc); in crypto_shash_init()
1002 sizeof(*desc) + crypto_shash_descsize(desc->tfm)); in shash_desc_zero()