Lines Matching refs:tfm
148 refcnt = crypto_tfm_ctx(request->tfm); in cryptd_enqueue_request()
199 static inline struct cryptd_queue *cryptd_get_queue(struct crypto_tfm *tfm) in cryptd_get_queue() argument
201 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_get_queue()
245 struct crypto_ablkcipher *tfm; in cryptd_blkcipher_crypt() local
254 desc.tfm = child; in cryptd_blkcipher_crypt()
263 tfm = crypto_ablkcipher_reqtfm(req); in cryptd_blkcipher_crypt()
264 ctx = crypto_ablkcipher_ctx(tfm); in cryptd_blkcipher_crypt()
272 crypto_free_ablkcipher(tfm); in cryptd_blkcipher_crypt()
277 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_encrypt()
286 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_decrypt()
297 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in cryptd_blkcipher_enqueue() local
300 queue = cryptd_get_queue(crypto_ablkcipher_tfm(tfm)); in cryptd_blkcipher_enqueue()
317 static int cryptd_blkcipher_init_tfm(struct crypto_tfm *tfm) in cryptd_blkcipher_init_tfm() argument
319 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_blkcipher_init_tfm()
322 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_blkcipher_init_tfm()
330 tfm->crt_ablkcipher.reqsize = in cryptd_blkcipher_init_tfm()
335 static void cryptd_blkcipher_exit_tfm(struct crypto_tfm *tfm) in cryptd_blkcipher_exit_tfm() argument
337 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_blkcipher_exit_tfm()
466 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_complete() local
467 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_complete()
476 crypto_free_skcipher(tfm); in cryptd_skcipher_complete()
484 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_encrypt() local
485 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_encrypt()
512 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_decrypt() local
513 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_decrypt()
539 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_enqueue() local
542 queue = cryptd_get_queue(crypto_skcipher_tfm(tfm)); in cryptd_skcipher_enqueue()
559 static int cryptd_skcipher_init_tfm(struct crypto_skcipher *tfm) in cryptd_skcipher_init_tfm() argument
561 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in cryptd_skcipher_init_tfm()
564 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_init_tfm()
573 tfm, sizeof(struct cryptd_skcipher_request_ctx)); in cryptd_skcipher_init_tfm()
577 static void cryptd_skcipher_exit_tfm(struct crypto_skcipher *tfm) in cryptd_skcipher_exit_tfm() argument
579 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_exit_tfm()
658 static int cryptd_hash_init_tfm(struct crypto_tfm *tfm) in cryptd_hash_init_tfm() argument
660 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_hash_init_tfm()
663 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_init_tfm()
671 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in cryptd_hash_init_tfm()
677 static void cryptd_hash_exit_tfm(struct crypto_tfm *tfm) in cryptd_hash_exit_tfm() argument
679 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_exit_tfm()
704 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue() local
706 cryptd_get_queue(crypto_ahash_tfm(tfm)); in cryptd_hash_enqueue()
716 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_complete() local
717 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_complete()
726 crypto_free_ahash(tfm); in cryptd_hash_complete()
731 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_init()
740 desc->tfm = child; in cryptd_hash_init()
823 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_digest()
832 desc->tfm = child; in cryptd_hash_digest()
857 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_import() local
858 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_import()
861 desc->tfm = ctx->child; in cryptd_hash_import()
958 struct crypto_aead *tfm; in cryptd_aead_crypt() local
964 tfm = crypto_aead_reqtfm(req); in cryptd_aead_crypt()
972 ctx = crypto_aead_ctx(tfm); in cryptd_aead_crypt()
980 crypto_free_aead(tfm); in cryptd_aead_crypt()
985 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_encrypt()
995 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_decrypt()
1007 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue() local
1008 struct cryptd_queue *queue = cryptd_get_queue(crypto_aead_tfm(tfm)); in cryptd_aead_enqueue()
1025 static int cryptd_aead_init_tfm(struct crypto_aead *tfm) in cryptd_aead_init_tfm() argument
1027 struct aead_instance *inst = aead_alg_instance(tfm); in cryptd_aead_init_tfm()
1030 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_init_tfm()
1039 tfm, max((unsigned)sizeof(struct cryptd_aead_request_ctx), in cryptd_aead_init_tfm()
1044 static void cryptd_aead_exit_tfm(struct crypto_aead *tfm) in cryptd_aead_exit_tfm() argument
1046 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_exit_tfm()
1168 struct crypto_tfm *tfm; in cryptd_alloc_ablkcipher() local
1176 tfm = crypto_alloc_base(cryptd_alg_name, type, mask); in cryptd_alloc_ablkcipher()
1177 if (IS_ERR(tfm)) in cryptd_alloc_ablkcipher()
1178 return ERR_CAST(tfm); in cryptd_alloc_ablkcipher()
1179 if (tfm->__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_ablkcipher()
1180 crypto_free_tfm(tfm); in cryptd_alloc_ablkcipher()
1184 ctx = crypto_tfm_ctx(tfm); in cryptd_alloc_ablkcipher()
1187 return __cryptd_ablkcipher_cast(__crypto_ablkcipher_cast(tfm)); in cryptd_alloc_ablkcipher()
1191 struct crypto_blkcipher *cryptd_ablkcipher_child(struct cryptd_ablkcipher *tfm) in cryptd_ablkcipher_child() argument
1193 struct cryptd_blkcipher_ctx *ctx = crypto_ablkcipher_ctx(&tfm->base); in cryptd_ablkcipher_child()
1198 bool cryptd_ablkcipher_queued(struct cryptd_ablkcipher *tfm) in cryptd_ablkcipher_queued() argument
1200 struct cryptd_blkcipher_ctx *ctx = crypto_ablkcipher_ctx(&tfm->base); in cryptd_ablkcipher_queued()
1206 void cryptd_free_ablkcipher(struct cryptd_ablkcipher *tfm) in cryptd_free_ablkcipher() argument
1208 struct cryptd_blkcipher_ctx *ctx = crypto_ablkcipher_ctx(&tfm->base); in cryptd_free_ablkcipher()
1211 crypto_free_ablkcipher(&tfm->base); in cryptd_free_ablkcipher()
1220 struct crypto_skcipher *tfm; in cryptd_alloc_skcipher() local
1226 tfm = crypto_alloc_skcipher(cryptd_alg_name, type, mask); in cryptd_alloc_skcipher()
1227 if (IS_ERR(tfm)) in cryptd_alloc_skcipher()
1228 return ERR_CAST(tfm); in cryptd_alloc_skcipher()
1230 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_skcipher()
1231 crypto_free_skcipher(tfm); in cryptd_alloc_skcipher()
1235 ctx = crypto_skcipher_ctx(tfm); in cryptd_alloc_skcipher()
1238 return container_of(tfm, struct cryptd_skcipher, base); in cryptd_alloc_skcipher()
1242 struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm) in cryptd_skcipher_child() argument
1244 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_child()
1250 bool cryptd_skcipher_queued(struct cryptd_skcipher *tfm) in cryptd_skcipher_queued() argument
1252 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_queued()
1258 void cryptd_free_skcipher(struct cryptd_skcipher *tfm) in cryptd_free_skcipher() argument
1260 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_free_skcipher()
1263 crypto_free_skcipher(&tfm->base); in cryptd_free_skcipher()
1272 struct crypto_ahash *tfm; in cryptd_alloc_ahash() local
1277 tfm = crypto_alloc_ahash(cryptd_alg_name, type, mask); in cryptd_alloc_ahash()
1278 if (IS_ERR(tfm)) in cryptd_alloc_ahash()
1279 return ERR_CAST(tfm); in cryptd_alloc_ahash()
1280 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_ahash()
1281 crypto_free_ahash(tfm); in cryptd_alloc_ahash()
1285 ctx = crypto_ahash_ctx(tfm); in cryptd_alloc_ahash()
1288 return __cryptd_ahash_cast(tfm); in cryptd_alloc_ahash()
1292 struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm) in cryptd_ahash_child() argument
1294 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_child()
1307 bool cryptd_ahash_queued(struct cryptd_ahash *tfm) in cryptd_ahash_queued() argument
1309 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_queued()
1315 void cryptd_free_ahash(struct cryptd_ahash *tfm) in cryptd_free_ahash() argument
1317 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_free_ahash()
1320 crypto_free_ahash(&tfm->base); in cryptd_free_ahash()
1329 struct crypto_aead *tfm; in cryptd_alloc_aead() local
1334 tfm = crypto_alloc_aead(cryptd_alg_name, type, mask); in cryptd_alloc_aead()
1335 if (IS_ERR(tfm)) in cryptd_alloc_aead()
1336 return ERR_CAST(tfm); in cryptd_alloc_aead()
1337 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) { in cryptd_alloc_aead()
1338 crypto_free_aead(tfm); in cryptd_alloc_aead()
1342 ctx = crypto_aead_ctx(tfm); in cryptd_alloc_aead()
1345 return __cryptd_aead_cast(tfm); in cryptd_alloc_aead()
1349 struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm) in cryptd_aead_child() argument
1352 ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_child()
1357 bool cryptd_aead_queued(struct cryptd_aead *tfm) in cryptd_aead_queued() argument
1359 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_queued()
1365 void cryptd_free_aead(struct cryptd_aead *tfm) in cryptd_free_aead() argument
1367 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_free_aead()
1370 crypto_free_aead(&tfm->base); in cryptd_free_aead()