Lines Matching refs:tfm

140 	refcnt = crypto_tfm_ctx(request->tfm);  in cryptd_enqueue_request()
186 static inline struct cryptd_queue *cryptd_get_queue(struct crypto_tfm *tfm) in cryptd_get_queue() argument
188 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_get_queue()
241 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_complete() local
242 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_complete()
251 crypto_free_skcipher(tfm); in cryptd_skcipher_complete()
259 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_encrypt() local
260 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_encrypt()
287 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_decrypt() local
288 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_decrypt()
314 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_enqueue() local
317 queue = cryptd_get_queue(crypto_skcipher_tfm(tfm)); in cryptd_skcipher_enqueue()
334 static int cryptd_skcipher_init_tfm(struct crypto_skcipher *tfm) in cryptd_skcipher_init_tfm() argument
336 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in cryptd_skcipher_init_tfm()
339 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_init_tfm()
348 tfm, sizeof(struct cryptd_skcipher_request_ctx)); in cryptd_skcipher_init_tfm()
352 static void cryptd_skcipher_exit_tfm(struct crypto_skcipher *tfm) in cryptd_skcipher_exit_tfm() argument
354 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_exit_tfm()
424 static int cryptd_hash_init_tfm(struct crypto_tfm *tfm) in cryptd_hash_init_tfm() argument
426 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_hash_init_tfm()
429 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_init_tfm()
437 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in cryptd_hash_init_tfm()
443 static void cryptd_hash_exit_tfm(struct crypto_tfm *tfm) in cryptd_hash_exit_tfm() argument
445 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_exit_tfm()
466 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue() local
468 cryptd_get_queue(crypto_ahash_tfm(tfm)); in cryptd_hash_enqueue()
478 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_complete() local
479 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_complete()
488 crypto_free_ahash(tfm); in cryptd_hash_complete()
493 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_init()
502 desc->tfm = child; in cryptd_hash_init()
584 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_digest()
593 desc->tfm = child; in cryptd_hash_digest()
617 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_import() local
618 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_import()
621 desc->tfm = ctx->child; in cryptd_hash_import()
720 struct crypto_aead *tfm; in cryptd_aead_crypt() local
726 tfm = crypto_aead_reqtfm(req); in cryptd_aead_crypt()
734 ctx = crypto_aead_ctx(tfm); in cryptd_aead_crypt()
742 crypto_free_aead(tfm); in cryptd_aead_crypt()
747 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_encrypt()
757 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_decrypt()
769 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue() local
770 struct cryptd_queue *queue = cryptd_get_queue(crypto_aead_tfm(tfm)); in cryptd_aead_enqueue()
787 static int cryptd_aead_init_tfm(struct crypto_aead *tfm) in cryptd_aead_init_tfm() argument
789 struct aead_instance *inst = aead_alg_instance(tfm); in cryptd_aead_init_tfm()
792 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_init_tfm()
801 tfm, max((unsigned)sizeof(struct cryptd_aead_request_ctx), in cryptd_aead_init_tfm()
806 static void cryptd_aead_exit_tfm(struct crypto_aead *tfm) in cryptd_aead_exit_tfm() argument
808 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_exit_tfm()
908 struct crypto_skcipher *tfm; in cryptd_alloc_skcipher() local
914 tfm = crypto_alloc_skcipher(cryptd_alg_name, type, mask); in cryptd_alloc_skcipher()
915 if (IS_ERR(tfm)) in cryptd_alloc_skcipher()
916 return ERR_CAST(tfm); in cryptd_alloc_skcipher()
918 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_skcipher()
919 crypto_free_skcipher(tfm); in cryptd_alloc_skcipher()
923 ctx = crypto_skcipher_ctx(tfm); in cryptd_alloc_skcipher()
926 return container_of(tfm, struct cryptd_skcipher, base); in cryptd_alloc_skcipher()
930 struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm) in cryptd_skcipher_child() argument
932 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_child()
938 bool cryptd_skcipher_queued(struct cryptd_skcipher *tfm) in cryptd_skcipher_queued() argument
940 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_queued()
946 void cryptd_free_skcipher(struct cryptd_skcipher *tfm) in cryptd_free_skcipher() argument
948 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_free_skcipher()
951 crypto_free_skcipher(&tfm->base); in cryptd_free_skcipher()
960 struct crypto_ahash *tfm; in cryptd_alloc_ahash() local
965 tfm = crypto_alloc_ahash(cryptd_alg_name, type, mask); in cryptd_alloc_ahash()
966 if (IS_ERR(tfm)) in cryptd_alloc_ahash()
967 return ERR_CAST(tfm); in cryptd_alloc_ahash()
968 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_ahash()
969 crypto_free_ahash(tfm); in cryptd_alloc_ahash()
973 ctx = crypto_ahash_ctx(tfm); in cryptd_alloc_ahash()
976 return __cryptd_ahash_cast(tfm); in cryptd_alloc_ahash()
980 struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm) in cryptd_ahash_child() argument
982 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_child()
995 bool cryptd_ahash_queued(struct cryptd_ahash *tfm) in cryptd_ahash_queued() argument
997 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_queued()
1003 void cryptd_free_ahash(struct cryptd_ahash *tfm) in cryptd_free_ahash() argument
1005 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_free_ahash()
1008 crypto_free_ahash(&tfm->base); in cryptd_free_ahash()
1017 struct crypto_aead *tfm; in cryptd_alloc_aead() local
1022 tfm = crypto_alloc_aead(cryptd_alg_name, type, mask); in cryptd_alloc_aead()
1023 if (IS_ERR(tfm)) in cryptd_alloc_aead()
1024 return ERR_CAST(tfm); in cryptd_alloc_aead()
1025 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_aead()
1026 crypto_free_aead(tfm); in cryptd_alloc_aead()
1030 ctx = crypto_aead_ctx(tfm); in cryptd_alloc_aead()
1033 return __cryptd_aead_cast(tfm); in cryptd_alloc_aead()
1037 struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm) in cryptd_aead_child() argument
1040 ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_child()
1045 bool cryptd_aead_queued(struct cryptd_aead *tfm) in cryptd_aead_queued() argument
1047 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_queued()
1053 void cryptd_free_aead(struct cryptd_aead *tfm) in cryptd_free_aead() argument
1055 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_free_aead()
1058 crypto_free_aead(&tfm->base); in cryptd_free_aead()