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()
270 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_complete() local
271 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_complete()
280 crypto_free_skcipher(tfm); in cryptd_skcipher_complete()
288 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_encrypt() local
289 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_encrypt()
316 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_decrypt() local
317 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_decrypt()
343 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_enqueue() local
346 queue = cryptd_get_queue(crypto_skcipher_tfm(tfm)); in cryptd_skcipher_enqueue()
363 static int cryptd_skcipher_init_tfm(struct crypto_skcipher *tfm) in cryptd_skcipher_init_tfm() argument
365 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in cryptd_skcipher_init_tfm()
368 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_init_tfm()
377 tfm, sizeof(struct cryptd_skcipher_request_ctx)); in cryptd_skcipher_init_tfm()
381 static void cryptd_skcipher_exit_tfm(struct crypto_skcipher *tfm) in cryptd_skcipher_exit_tfm() argument
383 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_exit_tfm()
463 static int cryptd_hash_init_tfm(struct crypto_tfm *tfm) in cryptd_hash_init_tfm() argument
465 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_hash_init_tfm()
468 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_init_tfm()
476 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in cryptd_hash_init_tfm()
482 static void cryptd_hash_exit_tfm(struct crypto_tfm *tfm) in cryptd_hash_exit_tfm() argument
484 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_exit_tfm()
509 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue() local
511 cryptd_get_queue(crypto_ahash_tfm(tfm)); in cryptd_hash_enqueue()
521 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_complete() local
522 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_complete()
531 crypto_free_ahash(tfm); in cryptd_hash_complete()
536 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_init()
545 desc->tfm = child; in cryptd_hash_init()
627 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_digest()
636 desc->tfm = child; in cryptd_hash_digest()
660 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_import() local
661 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_import()
664 desc->tfm = ctx->child; in cryptd_hash_import()
760 struct crypto_aead *tfm; in cryptd_aead_crypt() local
766 tfm = crypto_aead_reqtfm(req); in cryptd_aead_crypt()
774 ctx = crypto_aead_ctx(tfm); in cryptd_aead_crypt()
782 crypto_free_aead(tfm); in cryptd_aead_crypt()
787 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_encrypt()
797 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_decrypt()
809 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue() local
810 struct cryptd_queue *queue = cryptd_get_queue(crypto_aead_tfm(tfm)); in cryptd_aead_enqueue()
827 static int cryptd_aead_init_tfm(struct crypto_aead *tfm) in cryptd_aead_init_tfm() argument
829 struct aead_instance *inst = aead_alg_instance(tfm); in cryptd_aead_init_tfm()
832 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_init_tfm()
841 tfm, max((unsigned)sizeof(struct cryptd_aead_request_ctx), in cryptd_aead_init_tfm()
846 static void cryptd_aead_exit_tfm(struct crypto_aead *tfm) in cryptd_aead_exit_tfm() argument
848 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_exit_tfm()
966 struct crypto_skcipher *tfm; in cryptd_alloc_skcipher() local
972 tfm = crypto_alloc_skcipher(cryptd_alg_name, type, mask); in cryptd_alloc_skcipher()
973 if (IS_ERR(tfm)) in cryptd_alloc_skcipher()
974 return ERR_CAST(tfm); in cryptd_alloc_skcipher()
976 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_skcipher()
977 crypto_free_skcipher(tfm); in cryptd_alloc_skcipher()
981 ctx = crypto_skcipher_ctx(tfm); in cryptd_alloc_skcipher()
984 return container_of(tfm, struct cryptd_skcipher, base); in cryptd_alloc_skcipher()
988 struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm) in cryptd_skcipher_child() argument
990 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_child()
996 bool cryptd_skcipher_queued(struct cryptd_skcipher *tfm) in cryptd_skcipher_queued() argument
998 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_queued()
1004 void cryptd_free_skcipher(struct cryptd_skcipher *tfm) in cryptd_free_skcipher() argument
1006 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_free_skcipher()
1009 crypto_free_skcipher(&tfm->base); in cryptd_free_skcipher()
1018 struct crypto_ahash *tfm; in cryptd_alloc_ahash() local
1023 tfm = crypto_alloc_ahash(cryptd_alg_name, type, mask); in cryptd_alloc_ahash()
1024 if (IS_ERR(tfm)) in cryptd_alloc_ahash()
1025 return ERR_CAST(tfm); in cryptd_alloc_ahash()
1026 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_ahash()
1027 crypto_free_ahash(tfm); in cryptd_alloc_ahash()
1031 ctx = crypto_ahash_ctx(tfm); in cryptd_alloc_ahash()
1034 return __cryptd_ahash_cast(tfm); in cryptd_alloc_ahash()
1038 struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm) in cryptd_ahash_child() argument
1040 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_child()
1053 bool cryptd_ahash_queued(struct cryptd_ahash *tfm) in cryptd_ahash_queued() argument
1055 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_queued()
1061 void cryptd_free_ahash(struct cryptd_ahash *tfm) in cryptd_free_ahash() argument
1063 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_free_ahash()
1066 crypto_free_ahash(&tfm->base); in cryptd_free_ahash()
1075 struct crypto_aead *tfm; in cryptd_alloc_aead() local
1080 tfm = crypto_alloc_aead(cryptd_alg_name, type, mask); in cryptd_alloc_aead()
1081 if (IS_ERR(tfm)) in cryptd_alloc_aead()
1082 return ERR_CAST(tfm); in cryptd_alloc_aead()
1083 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_aead()
1084 crypto_free_aead(tfm); in cryptd_alloc_aead()
1088 ctx = crypto_aead_ctx(tfm); in cryptd_alloc_aead()
1091 return __cryptd_aead_cast(tfm); in cryptd_alloc_aead()
1095 struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm) in cryptd_aead_child() argument
1098 ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_child()
1103 bool cryptd_aead_queued(struct cryptd_aead *tfm) in cryptd_aead_queued() argument
1105 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_queued()
1111 void cryptd_free_aead(struct cryptd_aead *tfm) in cryptd_free_aead() argument
1113 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_free_aead()
1116 crypto_free_aead(&tfm->base); in cryptd_free_aead()