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;
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)
285 return container_of(tfm, struct crypto_ahash, base);
305 struct crypto_ahash *crypto_clone_ahash(struct crypto_ahash *tfm);
307 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm)
309 return &tfm->base;
314 * @tfm: cipher handle to be freed
316 * If @tfm is a NULL or error pointer, this function does nothing.
318 static inline void crypto_free_ahash(struct crypto_ahash *tfm)
320 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm));
335 static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm)
337 return crypto_tfm_alg_name(crypto_ahash_tfm(tfm));
340 static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm)
342 return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm));
346 struct crypto_ahash *tfm)
348 return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm));
353 * @tfm: cipher handle
360 static inline unsigned int crypto_ahash_blocksize(struct crypto_ahash *tfm)
362 return crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm));
372 struct crypto_ahash *tfm)
374 return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg);
379 * @tfm: cipher handle
387 static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm)
389 return crypto_hash_alg_common(tfm)->digestsize;
394 * @tfm: cipher handle
402 static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm)
404 return tfm->statesize;
407 static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm)
409 return crypto_tfm_get_flags(crypto_ahash_tfm(tfm));
412 static inline void crypto_ahash_set_flags(struct crypto_ahash *tfm, u32 flags)
414 crypto_tfm_set_flags(crypto_ahash_tfm(tfm), flags);
417 static inline void crypto_ahash_clear_flags(struct crypto_ahash *tfm, u32 flags)
419 crypto_tfm_clear_flags(crypto_ahash_tfm(tfm), flags);
435 return __crypto_ahash_cast(req->base.tfm);
440 * @tfm: cipher handle
444 static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm)
446 return tfm->reqsize;
456 * @tfm: cipher handle
465 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
540 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
542 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
545 return tfm->import(req, in);
561 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
563 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
566 return tfm->init(req);
603 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
604 struct hash_alg_common *alg = crypto_hash_alg_common(tfm);
609 return crypto_hash_errstat(alg, tfm->update(req));
626 * @tfm: cipher handle that shall be added to the request handle
632 struct crypto_ahash *tfm)
634 req->base.tfm = crypto_ahash_tfm(tfm);
639 * @tfm: cipher handle to be registered with the request
650 struct crypto_ahash *tfm, gfp_t gfp)
655 crypto_ahash_reqsize(tfm), gfp);
658 ahash_request_set_tfm(req, tfm);
771 struct crypto_shash *crypto_clone_shash(struct crypto_shash *tfm);
775 static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm)
777 return &tfm->base;
782 * @tfm: cipher handle to be freed
784 * If @tfm is a NULL or error pointer, this function does nothing.
786 static inline void crypto_free_shash(struct crypto_shash *tfm)
788 crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm));
791 static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm)
793 return crypto_tfm_alg_name(crypto_shash_tfm(tfm));
796 static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm)
798 return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm));
802 struct crypto_shash *tfm)
804 return crypto_tfm_alg_alignmask(crypto_shash_tfm(tfm));
809 * @tfm: cipher handle
816 static inline unsigned int crypto_shash_blocksize(struct crypto_shash *tfm)
818 return crypto_tfm_alg_blocksize(crypto_shash_tfm(tfm));
826 static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm)
828 return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg);
833 * @tfm: cipher handle
840 static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm)
842 return crypto_shash_alg(tfm)->digestsize;
845 static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm)
847 return crypto_shash_alg(tfm)->statesize;
850 static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm)
852 return crypto_tfm_get_flags(crypto_shash_tfm(tfm));
855 static inline void crypto_shash_set_flags(struct crypto_shash *tfm, u32 flags)
857 crypto_tfm_set_flags(crypto_shash_tfm(tfm), flags);
860 static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags)
862 crypto_tfm_clear_flags(crypto_shash_tfm(tfm), flags);
867 * @tfm: cipher handle
880 static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm)
882 return tfm->descsize;
892 * @tfm: cipher handle
903 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
926 * @tfm: hash transformation object
940 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data,
957 return crypto_shash_alg(desc->tfm)->export(desc, out);
974 struct crypto_shash *tfm = desc->tfm;
976 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
979 return crypto_shash_alg(tfm)->import(desc, in);
996 struct crypto_shash *tfm = desc->tfm;
998 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
1001 return crypto_shash_alg(tfm)->init(desc);
1056 sizeof(*desc) + crypto_shash_descsize(desc->tfm));