Lines Matching refs:tfm
136 refcnt = crypto_tfm_ctx(request->tfm); in cryptd_enqueue_request()
187 static inline struct cryptd_queue *cryptd_get_queue(struct crypto_tfm *tfm) in cryptd_get_queue() argument
189 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_get_queue()
242 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_complete() local
243 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_complete()
252 crypto_free_skcipher(tfm); in cryptd_skcipher_complete()
260 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_encrypt() local
261 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_encrypt()
288 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_decrypt() local
289 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_decrypt()
315 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_enqueue() local
318 queue = cryptd_get_queue(crypto_skcipher_tfm(tfm)); in cryptd_skcipher_enqueue()
335 static int cryptd_skcipher_init_tfm(struct crypto_skcipher *tfm) in cryptd_skcipher_init_tfm() argument
337 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in cryptd_skcipher_init_tfm()
340 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_init_tfm()
349 tfm, sizeof(struct cryptd_skcipher_request_ctx)); in cryptd_skcipher_init_tfm()
353 static void cryptd_skcipher_exit_tfm(struct crypto_skcipher *tfm) in cryptd_skcipher_exit_tfm() argument
355 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_exit_tfm()
425 static int cryptd_hash_init_tfm(struct crypto_tfm *tfm) in cryptd_hash_init_tfm() argument
427 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_hash_init_tfm()
430 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_init_tfm()
438 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in cryptd_hash_init_tfm()
444 static void cryptd_hash_exit_tfm(struct crypto_tfm *tfm) in cryptd_hash_exit_tfm() argument
446 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_exit_tfm()
467 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue() local
469 cryptd_get_queue(crypto_ahash_tfm(tfm)); in cryptd_hash_enqueue()
479 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_complete() local
480 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_complete()
489 crypto_free_ahash(tfm); in cryptd_hash_complete()
494 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_init()
503 desc->tfm = child; in cryptd_hash_init()
585 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_digest()
594 desc->tfm = child; in cryptd_hash_digest()
618 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_import() local
619 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_import()
622 desc->tfm = ctx->child; in cryptd_hash_import()
721 struct crypto_aead *tfm; in cryptd_aead_crypt() local
727 tfm = crypto_aead_reqtfm(req); in cryptd_aead_crypt()
735 ctx = crypto_aead_ctx(tfm); in cryptd_aead_crypt()
743 crypto_free_aead(tfm); in cryptd_aead_crypt()
748 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_encrypt()
758 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_decrypt()
770 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue() local
771 struct cryptd_queue *queue = cryptd_get_queue(crypto_aead_tfm(tfm)); in cryptd_aead_enqueue()
788 static int cryptd_aead_init_tfm(struct crypto_aead *tfm) in cryptd_aead_init_tfm() argument
790 struct aead_instance *inst = aead_alg_instance(tfm); in cryptd_aead_init_tfm()
793 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_init_tfm()
802 tfm, max((unsigned)sizeof(struct cryptd_aead_request_ctx), in cryptd_aead_init_tfm()
807 static void cryptd_aead_exit_tfm(struct crypto_aead *tfm) in cryptd_aead_exit_tfm() argument
809 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_exit_tfm()
909 struct crypto_skcipher *tfm; in cryptd_alloc_skcipher() local
915 tfm = crypto_alloc_skcipher(cryptd_alg_name, type, mask); in cryptd_alloc_skcipher()
916 if (IS_ERR(tfm)) in cryptd_alloc_skcipher()
917 return ERR_CAST(tfm); in cryptd_alloc_skcipher()
919 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_skcipher()
920 crypto_free_skcipher(tfm); in cryptd_alloc_skcipher()
924 ctx = crypto_skcipher_ctx(tfm); in cryptd_alloc_skcipher()
927 return container_of(tfm, struct cryptd_skcipher, base); in cryptd_alloc_skcipher()
931 struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm) in cryptd_skcipher_child() argument
933 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_child()
939 bool cryptd_skcipher_queued(struct cryptd_skcipher *tfm) in cryptd_skcipher_queued() argument
941 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_queued()
947 void cryptd_free_skcipher(struct cryptd_skcipher *tfm) in cryptd_free_skcipher() argument
949 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_free_skcipher()
952 crypto_free_skcipher(&tfm->base); in cryptd_free_skcipher()
961 struct crypto_ahash *tfm; in cryptd_alloc_ahash() local
966 tfm = crypto_alloc_ahash(cryptd_alg_name, type, mask); in cryptd_alloc_ahash()
967 if (IS_ERR(tfm)) in cryptd_alloc_ahash()
968 return ERR_CAST(tfm); in cryptd_alloc_ahash()
969 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_ahash()
970 crypto_free_ahash(tfm); in cryptd_alloc_ahash()
974 ctx = crypto_ahash_ctx(tfm); in cryptd_alloc_ahash()
977 return __cryptd_ahash_cast(tfm); in cryptd_alloc_ahash()
981 struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm) in cryptd_ahash_child() argument
983 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_child()
996 bool cryptd_ahash_queued(struct cryptd_ahash *tfm) in cryptd_ahash_queued() argument
998 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_queued()
1004 void cryptd_free_ahash(struct cryptd_ahash *tfm) in cryptd_free_ahash() argument
1006 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_free_ahash()
1009 crypto_free_ahash(&tfm->base); in cryptd_free_ahash()
1018 struct crypto_aead *tfm; in cryptd_alloc_aead() local
1023 tfm = crypto_alloc_aead(cryptd_alg_name, type, mask); in cryptd_alloc_aead()
1024 if (IS_ERR(tfm)) in cryptd_alloc_aead()
1025 return ERR_CAST(tfm); in cryptd_alloc_aead()
1026 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_aead()
1027 crypto_free_aead(tfm); in cryptd_alloc_aead()
1031 ctx = crypto_aead_ctx(tfm); in cryptd_alloc_aead()
1034 return __cryptd_aead_cast(tfm); in cryptd_alloc_aead()
1038 struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm) in cryptd_aead_child() argument
1041 ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_child()
1046 bool cryptd_aead_queued(struct cryptd_aead *tfm) in cryptd_aead_queued() argument
1048 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_queued()
1054 void cryptd_free_aead(struct cryptd_aead *tfm) in cryptd_free_aead() argument
1056 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_free_aead()
1059 crypto_free_aead(&tfm->base); in cryptd_free_aead()