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;
232 int (*setkey)(struct crypto_shash *tfm, const u8 *key,
234 int (*init_tfm)(struct crypto_shash *tfm);
235 void (*exit_tfm)(struct crypto_shash *tfm);
270 static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm)
272 return container_of(tfm, struct crypto_ahash, base);
292 struct crypto_ahash *crypto_clone_ahash(struct crypto_ahash *tfm);
294 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm)
296 return &tfm->base;
301 * @tfm: cipher handle to be freed
303 * If @tfm is a NULL or error pointer, this function does nothing.
305 static inline void crypto_free_ahash(struct crypto_ahash *tfm)
307 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm));
322 static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm)
324 return crypto_tfm_alg_name(crypto_ahash_tfm(tfm));
327 static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm)
329 return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm));
334 * @tfm: cipher handle
341 static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm)
343 return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm));
353 struct crypto_ahash *tfm)
355 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg);
360 * @tfm: cipher handle
368 static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm)
370 return crypto_hash_alg_common(tfm)->digestsize;
375 * @tfm: cipher handle
383 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm)
385 return tfm->statesize;
388 static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm)
390 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm));
393 static inline void crypto_ahash_set_flags(struct crypto_ahash *tfm, u32 flags)
395 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags);
398 static inline void crypto_ahash_clear_flags(struct crypto_ahash *tfm, u32 flags)
400 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags);
416 return __crypto_ahash_cast(req->base.tfm);
421 * @tfm: cipher handle
425 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm)
427 return tfm->reqsize;
437 * @tfm: cipher handle
446 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
558 * @tfm: cipher handle that shall be added to the request handle
564 struct crypto_ahash *tfm)
566 req->base.tfm = crypto_ahash_tfm(tfm);
571 * @tfm: cipher handle to be registered with the request
582 struct crypto_ahash *tfm, gfp_t gfp)
587 crypto_ahash_reqsize(tfm), gfp);
590 ahash_request_set_tfm(req, tfm);
703 struct crypto_shash *crypto_clone_shash(struct crypto_shash *tfm);
707 static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm)
709 return &tfm->base;
714 * @tfm: cipher handle to be freed
716 * If @tfm is a NULL or error pointer, this function does nothing.
718 static inline void crypto_free_shash(struct crypto_shash *tfm)
720 crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm));
723 static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm)
725 return crypto_tfm_alg_name(crypto_shash_tfm(tfm));
728 static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm)
730 return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm));
735 * @tfm: cipher handle
742 static inline unsigned int crypto_shash_blocksize(struct crypto_shash *tfm)
744 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm));
752 static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm)
754 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg);
759 * @tfm: cipher handle
766 static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm)
768 return crypto_shash_alg(tfm)->digestsize;
771 static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm)
773 return crypto_shash_alg(tfm)->statesize;
776 static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm)
778 return crypto_tfm_get_flags(crypto_shash_tfm(tfm));
781 static inline void crypto_shash_set_flags(struct crypto_shash *tfm, u32 flags)
783 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags);
786 static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags)
788 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags);
793 * @tfm: cipher handle
806 static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm)
808 return tfm->descsize;
818 * @tfm: cipher handle
829 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
852 * @tfm: hash transformation object
866 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data,
911 struct crypto_shash *tfm = desc->tfm;
913 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
916 return crypto_shash_alg(tfm)->init(desc);
971 sizeof(*desc) + crypto_shash_descsize(desc->tfm));