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;
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)
256 return container_of(tfm, struct crypto_ahash, base);
276 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm)
278 return &tfm->base;
283 * @tfm: cipher handle to be freed
285 * If @tfm is a NULL or error pointer, this function does nothing.
287 static inline void crypto_free_ahash(struct crypto_ahash *tfm)
289 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm));
304 static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm)
306 return crypto_tfm_alg_name(crypto_ahash_tfm(tfm));
309 static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm)
311 return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm));
315 struct crypto_ahash *tfm)
317 return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm));
322 * @tfm: cipher handle
329 static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm)
331 return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm));
341 struct crypto_ahash *tfm)
343 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg);
348 * @tfm: cipher handle
356 static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm)
358 return crypto_hash_alg_common(tfm)->digestsize;
363 * @tfm: cipher handle
371 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm)
373 return crypto_hash_alg_common(tfm)->statesize;
376 static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm)
378 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm));
381 static inline void crypto_ahash_set_flags(struct crypto_ahash *tfm, u32 flags)
383 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags);
386 static inline void crypto_ahash_clear_flags(struct crypto_ahash *tfm, u32 flags)
388 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags);
404 return __crypto_ahash_cast(req->base.tfm);
409 * @tfm: cipher handle
413 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm)
415 return tfm->reqsize;
425 * @tfm: cipher handle
434 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
509 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
511 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
514 return tfm->import(req, in);
530 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
532 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
535 return tfm->init(req);
551 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
552 struct crypto_alg *alg = tfm->base.__crt_alg;
576 * @tfm: cipher handle that shall be added to the request handle
582 struct crypto_ahash *tfm)
584 req->base.tfm = crypto_ahash_tfm(tfm);
589 * @tfm: cipher handle to be registered with the request
600 struct crypto_ahash *tfm, gfp_t gfp)
605 crypto_ahash_reqsize(tfm), gfp);
608 ahash_request_set_tfm(req, tfm);
721 static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm)
723 return &tfm->base;
728 * @tfm: cipher handle to be freed
730 * If @tfm is a NULL or error pointer, this function does nothing.
732 static inline void crypto_free_shash(struct crypto_shash *tfm)
734 crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm));
737 static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm)
739 return crypto_tfm_alg_name(crypto_shash_tfm(tfm));
742 static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm)
744 return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm));
748 struct crypto_shash *tfm)
750 return crypto_tfm_alg_alignmask(crypto_shash_tfm(tfm));
755 * @tfm: cipher handle
762 static inline unsigned int crypto_shash_blocksize(struct crypto_shash *tfm)
764 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm));
772 static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm)
774 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg);
779 * @tfm: cipher handle
786 static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm)
788 return crypto_shash_alg(tfm)->digestsize;
791 static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm)
793 return crypto_shash_alg(tfm)->statesize;
796 static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm)
798 return crypto_tfm_get_flags(crypto_shash_tfm(tfm));
801 static inline void crypto_shash_set_flags(struct crypto_shash *tfm, u32 flags)
803 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags);
806 static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags)
808 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags);
813 * @tfm: cipher handle
826 static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm)
828 return tfm->descsize;
838 * @tfm: cipher handle
849 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
872 * @tfm: hash transformation object
886 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data,
903 return crypto_shash_alg(desc->tfm)->export(desc, out);
920 struct crypto_shash *tfm = desc->tfm;
922 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
925 return crypto_shash_alg(tfm)->import(desc, in);
942 struct crypto_shash *tfm = desc->tfm;
944 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
947 return crypto_shash_alg(tfm)->init(desc);
1002 sizeof(*desc) + crypto_shash_descsize(desc->tfm));