Lines Matching refs:tfm

166 	int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
168 int (*init_tfm)(struct crypto_ahash *tfm);
169 void (*exit_tfm)(struct crypto_ahash *tfm);
176 struct crypto_shash *tfm; member
236 int (*setkey)(struct crypto_shash *tfm, const u8 *key,
238 int (*init_tfm)(struct crypto_shash *tfm);
239 void (*exit_tfm)(struct crypto_shash *tfm);
260 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
283 static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm) in __crypto_ahash_cast() argument
285 return container_of(tfm, struct crypto_ahash, base); in __crypto_ahash_cast()
305 struct crypto_ahash *crypto_clone_ahash(struct crypto_ahash *tfm);
307 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm) in crypto_ahash_tfm() argument
309 return &tfm->base; in crypto_ahash_tfm()
318 static inline void crypto_free_ahash(struct crypto_ahash *tfm) in crypto_free_ahash() argument
320 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm)); in crypto_free_ahash()
335 static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm) in crypto_ahash_alg_name() argument
337 return crypto_tfm_alg_name(crypto_ahash_tfm(tfm)); in crypto_ahash_alg_name()
340 static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm) in crypto_ahash_driver_name() argument
342 return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm)); in crypto_ahash_driver_name()
346 struct crypto_ahash *tfm) in crypto_ahash_alignmask() argument
348 return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm)); in crypto_ahash_alignmask()
360 static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm) in crypto_ahash_blocksize() argument
362 return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in crypto_ahash_blocksize()
372 struct crypto_ahash *tfm) in crypto_hash_alg_common() argument
374 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg); in crypto_hash_alg_common()
387 static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm) in crypto_ahash_digestsize() argument
389 return crypto_hash_alg_common(tfm)->digestsize; in crypto_ahash_digestsize()
402 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm) in crypto_ahash_statesize() argument
404 return tfm->statesize; in crypto_ahash_statesize()
407 static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm) in crypto_ahash_get_flags() argument
409 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm)); in crypto_ahash_get_flags()
412 static inline void crypto_ahash_set_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_set_flags() argument
414 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_set_flags()
417 static inline void crypto_ahash_clear_flags(struct crypto_ahash *tfm, u32 flags) in crypto_ahash_clear_flags() argument
419 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags); in crypto_ahash_clear_flags()
435 return __crypto_ahash_cast(req->base.tfm); in crypto_ahash_reqtfm()
444 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm) in crypto_ahash_reqsize() argument
446 return tfm->reqsize; in crypto_ahash_reqsize()
465 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
540 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_import() local
542 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_import()
545 return tfm->import(req, in); in crypto_ahash_import()
561 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_init() local
563 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_init()
566 return tfm->init(req); in crypto_ahash_init()
603 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_update() local
604 struct hash_alg_common *alg = crypto_hash_alg_common(tfm); in crypto_ahash_update()
609 return crypto_hash_errstat(alg, tfm->update(req)); in crypto_ahash_update()
632 struct crypto_ahash *tfm) in ahash_request_set_tfm() argument
634 req->base.tfm = crypto_ahash_tfm(tfm); in ahash_request_set_tfm()
650 struct crypto_ahash *tfm, gfp_t gfp) in ahash_request_alloc() argument
655 crypto_ahash_reqsize(tfm), gfp); in ahash_request_alloc()
658 ahash_request_set_tfm(req, tfm); in ahash_request_alloc()
771 struct crypto_shash *crypto_clone_shash(struct crypto_shash *tfm);
775 static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm) in crypto_shash_tfm() argument
777 return &tfm->base; in crypto_shash_tfm()
786 static inline void crypto_free_shash(struct crypto_shash *tfm) in crypto_free_shash() argument
788 crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm)); in crypto_free_shash()
791 static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm) in crypto_shash_alg_name() argument
793 return crypto_tfm_alg_name(crypto_shash_tfm(tfm)); in crypto_shash_alg_name()
796 static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm) in crypto_shash_driver_name() argument
798 return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm)); in crypto_shash_driver_name()
802 struct crypto_shash *tfm) in crypto_shash_alignmask() argument
804 return crypto_tfm_alg_alignmask(crypto_shash_tfm(tfm)); in crypto_shash_alignmask()
816 static inline unsigned int crypto_shash_blocksize(struct crypto_shash *tfm) in crypto_shash_blocksize() argument
818 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm)); in crypto_shash_blocksize()
826 static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm) in crypto_shash_alg() argument
828 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg); in crypto_shash_alg()
840 static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm) in crypto_shash_digestsize() argument
842 return crypto_shash_alg(tfm)->digestsize; in crypto_shash_digestsize()
845 static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm) in crypto_shash_statesize() argument
847 return crypto_shash_alg(tfm)->statesize; in crypto_shash_statesize()
850 static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm) in crypto_shash_get_flags() argument
852 return crypto_tfm_get_flags(crypto_shash_tfm(tfm)); in crypto_shash_get_flags()
855 static inline void crypto_shash_set_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_set_flags() argument
857 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_set_flags()
860 static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags) in crypto_shash_clear_flags() argument
862 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags); in crypto_shash_clear_flags()
880 static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm) in crypto_shash_descsize() argument
882 return tfm->descsize; in crypto_shash_descsize()
903 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
940 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data,
957 return crypto_shash_alg(desc->tfm)->export(desc, out); in crypto_shash_export()
974 struct crypto_shash *tfm = desc->tfm; in crypto_shash_import() local
976 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_import()
979 return crypto_shash_alg(tfm)->import(desc, in); in crypto_shash_import()
996 struct crypto_shash *tfm = desc->tfm; in crypto_shash_init() local
998 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_init()
1001 return crypto_shash_alg(tfm)->init(desc); in crypto_shash_init()
1056 sizeof(*desc) + crypto_shash_descsize(desc->tfm)); in shash_desc_zero()