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()
217 desc.tfm = child; in cryptd_blkcipher_crypt()
233 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_encrypt()
242 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_decrypt()
253 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in cryptd_blkcipher_enqueue() local
256 queue = cryptd_get_queue(crypto_ablkcipher_tfm(tfm)); in cryptd_blkcipher_enqueue()
273 static int cryptd_blkcipher_init_tfm(struct crypto_tfm *tfm) in cryptd_blkcipher_init_tfm() argument
275 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_blkcipher_init_tfm()
278 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_blkcipher_init_tfm()
286 tfm->crt_ablkcipher.reqsize = in cryptd_blkcipher_init_tfm()
291 static void cryptd_blkcipher_exit_tfm(struct crypto_tfm *tfm) in cryptd_blkcipher_exit_tfm() argument
293 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_blkcipher_exit_tfm()
394 static int cryptd_hash_init_tfm(struct crypto_tfm *tfm) in cryptd_hash_init_tfm() argument
396 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_hash_init_tfm()
399 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_init_tfm()
407 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in cryptd_hash_init_tfm()
413 static void cryptd_hash_exit_tfm(struct crypto_tfm *tfm) in cryptd_hash_exit_tfm() argument
415 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_exit_tfm()
440 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue() local
442 cryptd_get_queue(crypto_ahash_tfm(tfm)); in cryptd_hash_enqueue()
452 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_init()
461 desc->tfm = child; in cryptd_hash_init()
552 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_digest()
561 desc->tfm = child; in cryptd_hash_digest()
678 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_encrypt()
688 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_decrypt()
700 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue() local
701 struct cryptd_queue *queue = cryptd_get_queue(crypto_aead_tfm(tfm)); in cryptd_aead_enqueue()
718 static int cryptd_aead_init_tfm(struct crypto_tfm *tfm) in cryptd_aead_init_tfm() argument
720 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_aead_init_tfm()
723 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_aead_init_tfm()
732 tfm->crt_aead.reqsize = sizeof(struct cryptd_aead_request_ctx); in cryptd_aead_init_tfm()
736 static void cryptd_aead_exit_tfm(struct crypto_tfm *tfm) in cryptd_aead_exit_tfm() argument
738 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_aead_exit_tfm()
855 struct crypto_tfm *tfm; in cryptd_alloc_ablkcipher() local
864 tfm = crypto_alloc_base(cryptd_alg_name, type, mask); in cryptd_alloc_ablkcipher()
865 if (IS_ERR(tfm)) in cryptd_alloc_ablkcipher()
866 return ERR_CAST(tfm); in cryptd_alloc_ablkcipher()
867 if (tfm->__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_ablkcipher()
868 crypto_free_tfm(tfm); in cryptd_alloc_ablkcipher()
872 return __cryptd_ablkcipher_cast(__crypto_ablkcipher_cast(tfm)); in cryptd_alloc_ablkcipher()
876 struct crypto_blkcipher *cryptd_ablkcipher_child(struct cryptd_ablkcipher *tfm) in cryptd_ablkcipher_child() argument
878 struct cryptd_blkcipher_ctx *ctx = crypto_ablkcipher_ctx(&tfm->base); in cryptd_ablkcipher_child()
883 void cryptd_free_ablkcipher(struct cryptd_ablkcipher *tfm) in cryptd_free_ablkcipher() argument
885 crypto_free_ablkcipher(&tfm->base); in cryptd_free_ablkcipher()
893 struct crypto_ahash *tfm; in cryptd_alloc_ahash() local
898 tfm = crypto_alloc_ahash(cryptd_alg_name, type, mask); in cryptd_alloc_ahash()
899 if (IS_ERR(tfm)) in cryptd_alloc_ahash()
900 return ERR_CAST(tfm); in cryptd_alloc_ahash()
901 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_ahash()
902 crypto_free_ahash(tfm); in cryptd_alloc_ahash()
906 return __cryptd_ahash_cast(tfm); in cryptd_alloc_ahash()
910 struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm) in cryptd_ahash_child() argument
912 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_child()
925 void cryptd_free_ahash(struct cryptd_ahash *tfm) in cryptd_free_ahash() argument
927 crypto_free_ahash(&tfm->base); in cryptd_free_ahash()
935 struct crypto_aead *tfm; in cryptd_alloc_aead() local
940 tfm = crypto_alloc_aead(cryptd_alg_name, type, mask); in cryptd_alloc_aead()
941 if (IS_ERR(tfm)) in cryptd_alloc_aead()
942 return ERR_CAST(tfm); in cryptd_alloc_aead()
943 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_aead()
944 crypto_free_aead(tfm); in cryptd_alloc_aead()
947 return __cryptd_aead_cast(tfm); in cryptd_alloc_aead()
951 struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm) in cryptd_aead_child() argument
954 ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_child()
959 void cryptd_free_aead(struct cryptd_aead *tfm) in cryptd_free_aead() argument
961 crypto_free_aead(&tfm->base); in cryptd_free_aead()