Lines Matching refs:tfm
164 static inline struct cryptd_queue *cryptd_get_queue(struct crypto_tfm *tfm) in cryptd_get_queue() argument
166 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_get_queue()
216 desc.tfm = child; in cryptd_blkcipher_crypt()
232 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_encrypt()
241 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_decrypt()
252 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in cryptd_blkcipher_enqueue() local
255 queue = cryptd_get_queue(crypto_ablkcipher_tfm(tfm)); in cryptd_blkcipher_enqueue()
272 static int cryptd_blkcipher_init_tfm(struct crypto_tfm *tfm) in cryptd_blkcipher_init_tfm() argument
274 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_blkcipher_init_tfm()
277 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_blkcipher_init_tfm()
285 tfm->crt_ablkcipher.reqsize = in cryptd_blkcipher_init_tfm()
290 static void cryptd_blkcipher_exit_tfm(struct crypto_tfm *tfm) in cryptd_blkcipher_exit_tfm() argument
292 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_blkcipher_exit_tfm()
403 static int cryptd_hash_init_tfm(struct crypto_tfm *tfm) in cryptd_hash_init_tfm() argument
405 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_hash_init_tfm()
408 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_init_tfm()
416 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in cryptd_hash_init_tfm()
422 static void cryptd_hash_exit_tfm(struct crypto_tfm *tfm) in cryptd_hash_exit_tfm() argument
424 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_exit_tfm()
449 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue() local
451 cryptd_get_queue(crypto_ahash_tfm(tfm)); in cryptd_hash_enqueue()
461 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_init()
470 desc->tfm = child; in cryptd_hash_init()
561 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_digest()
570 desc->tfm = child; in cryptd_hash_digest()
707 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_encrypt()
717 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_decrypt()
729 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue() local
730 struct cryptd_queue *queue = cryptd_get_queue(crypto_aead_tfm(tfm)); in cryptd_aead_enqueue()
747 static int cryptd_aead_init_tfm(struct crypto_aead *tfm) in cryptd_aead_init_tfm() argument
749 struct aead_instance *inst = aead_alg_instance(tfm); in cryptd_aead_init_tfm()
752 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_init_tfm()
761 tfm, max((unsigned)sizeof(struct cryptd_aead_request_ctx), in cryptd_aead_init_tfm()
766 static void cryptd_aead_exit_tfm(struct crypto_aead *tfm) in cryptd_aead_exit_tfm() argument
768 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_exit_tfm()
885 struct crypto_tfm *tfm; in cryptd_alloc_ablkcipher() local
894 tfm = crypto_alloc_base(cryptd_alg_name, type, mask); in cryptd_alloc_ablkcipher()
895 if (IS_ERR(tfm)) in cryptd_alloc_ablkcipher()
896 return ERR_CAST(tfm); in cryptd_alloc_ablkcipher()
897 if (tfm->__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_ablkcipher()
898 crypto_free_tfm(tfm); in cryptd_alloc_ablkcipher()
902 return __cryptd_ablkcipher_cast(__crypto_ablkcipher_cast(tfm)); in cryptd_alloc_ablkcipher()
906 struct crypto_blkcipher *cryptd_ablkcipher_child(struct cryptd_ablkcipher *tfm) in cryptd_ablkcipher_child() argument
908 struct cryptd_blkcipher_ctx *ctx = crypto_ablkcipher_ctx(&tfm->base); in cryptd_ablkcipher_child()
913 void cryptd_free_ablkcipher(struct cryptd_ablkcipher *tfm) in cryptd_free_ablkcipher() argument
915 crypto_free_ablkcipher(&tfm->base); in cryptd_free_ablkcipher()
923 struct crypto_ahash *tfm; in cryptd_alloc_ahash() local
928 tfm = crypto_alloc_ahash(cryptd_alg_name, type, mask); in cryptd_alloc_ahash()
929 if (IS_ERR(tfm)) in cryptd_alloc_ahash()
930 return ERR_CAST(tfm); in cryptd_alloc_ahash()
931 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_ahash()
932 crypto_free_ahash(tfm); in cryptd_alloc_ahash()
936 return __cryptd_ahash_cast(tfm); in cryptd_alloc_ahash()
940 struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm) in cryptd_ahash_child() argument
942 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_child()
955 void cryptd_free_ahash(struct cryptd_ahash *tfm) in cryptd_free_ahash() argument
957 crypto_free_ahash(&tfm->base); in cryptd_free_ahash()
965 struct crypto_aead *tfm; in cryptd_alloc_aead() local
970 tfm = crypto_alloc_aead(cryptd_alg_name, type, mask); in cryptd_alloc_aead()
971 if (IS_ERR(tfm)) in cryptd_alloc_aead()
972 return ERR_CAST(tfm); in cryptd_alloc_aead()
973 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_aead()
974 crypto_free_aead(tfm); in cryptd_alloc_aead()
977 return __cryptd_aead_cast(tfm); in cryptd_alloc_aead()
981 struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm) in cryptd_aead_child() argument
984 ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_child()
989 void cryptd_free_aead(struct cryptd_aead *tfm) in cryptd_free_aead() argument
991 crypto_free_aead(&tfm->base); in cryptd_free_aead()