Lines Matching defs:tfm

145 	int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
147 int (*init_tfm)(struct crypto_ahash *tfm);
148 void (*exit_tfm)(struct crypto_ahash *tfm);
155 struct crypto_shash *tfm;
211 int (*setkey)(struct crypto_shash *tfm, const u8 *key,
213 int (*init_tfm)(struct crypto_shash *tfm);
214 void (*exit_tfm)(struct crypto_shash *tfm);
248 static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm)
250 return container_of(tfm, struct crypto_ahash, base);
270 struct crypto_ahash *crypto_clone_ahash(struct crypto_ahash *tfm);
272 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm)
274 return &tfm->base;
279 * @tfm: cipher handle to be freed
281 * If @tfm is a NULL or error pointer, this function does nothing.
283 static inline void crypto_free_ahash(struct crypto_ahash *tfm)
285 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm));
300 static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm)
302 return crypto_tfm_alg_name(crypto_ahash_tfm(tfm));
305 static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm)
307 return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm));
312 * @tfm: cipher handle
319 static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm)
321 return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm));
331 struct crypto_ahash *tfm)
333 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg);
338 * @tfm: cipher handle
346 static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm)
348 return crypto_hash_alg_common(tfm)->digestsize;
353 * @tfm: cipher handle
361 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm)
363 return tfm->statesize;
366 static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm)
368 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm));
371 static inline void crypto_ahash_set_flags(struct crypto_ahash *tfm, u32 flags)
373 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags);
376 static inline void crypto_ahash_clear_flags(struct crypto_ahash *tfm, u32 flags)
378 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags);
394 return __crypto_ahash_cast(req->base.tfm);
399 * @tfm: cipher handle
403 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm)
405 return tfm->reqsize;
415 * @tfm: cipher handle
424 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
536 * @tfm: cipher handle that shall be added to the request handle
542 struct crypto_ahash *tfm)
544 req->base.tfm = crypto_ahash_tfm(tfm);
549 * @tfm: cipher handle to be registered with the request
560 struct crypto_ahash *tfm, gfp_t gfp)
565 crypto_ahash_reqsize(tfm), gfp);
568 ahash_request_set_tfm(req, tfm);
682 struct crypto_shash *crypto_clone_shash(struct crypto_shash *tfm);
686 static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm)
688 return &tfm->base;
693 * @tfm: cipher handle to be freed
695 * If @tfm is a NULL or error pointer, this function does nothing.
697 static inline void crypto_free_shash(struct crypto_shash *tfm)
699 crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm));
702 static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm)
704 return crypto_tfm_alg_name(crypto_shash_tfm(tfm));
707 static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm)
709 return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm));
714 * @tfm: cipher handle
721 static inline unsigned int crypto_shash_blocksize(struct crypto_shash *tfm)
723 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm));
731 static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm)
733 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg);
738 * @tfm: cipher handle
745 static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm)
747 return crypto_shash_alg(tfm)->digestsize;
750 static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm)
752 return crypto_shash_alg(tfm)->statesize;
755 static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm)
757 return crypto_tfm_get_flags(crypto_shash_tfm(tfm));
760 static inline void crypto_shash_set_flags(struct crypto_shash *tfm, u32 flags)
762 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags);
765 static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags)
767 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags);
772 * @tfm: cipher handle
785 static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm)
787 return tfm->descsize;
797 * @tfm: cipher handle
808 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
831 * @tfm: hash transformation object
845 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data,
890 struct crypto_shash *tfm = desc->tfm;
892 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
895 return crypto_shash_alg(tfm)->init(desc);
950 sizeof(*desc) + crypto_shash_descsize(desc->tfm));