Lines Matching defs:tfm
141 refcnt = crypto_tfm_ctx(request->tfm);
187 static inline struct cryptd_queue *cryptd_get_queue(struct crypto_tfm *tfm)
189 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm);
242 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
243 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm);
252 crypto_free_skcipher(tfm);
260 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
261 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm);
288 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
289 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm);
315 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
318 queue = cryptd_get_queue(crypto_skcipher_tfm(tfm));
335 static int cryptd_skcipher_init_tfm(struct crypto_skcipher *tfm)
337 struct skcipher_instance *inst = skcipher_alg_instance(tfm);
340 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm);
349 tfm, sizeof(struct cryptd_skcipher_request_ctx) +
354 static void cryptd_skcipher_exit_tfm(struct crypto_skcipher *tfm)
356 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm);
426 static int cryptd_hash_init_tfm(struct crypto_tfm *tfm)
428 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm);
431 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm);
439 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
445 static void cryptd_hash_exit_tfm(struct crypto_tfm *tfm)
447 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm);
468 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
470 cryptd_get_queue(crypto_ahash_tfm(tfm));
480 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
481 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm);
490 crypto_free_ahash(tfm);
495 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm);
504 desc->tfm = child;
586 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm);
595 desc->tfm = child;
619 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
620 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm);
623 desc->tfm = ctx->child;
722 struct crypto_aead *tfm;
728 tfm = crypto_aead_reqtfm(req);
736 ctx = crypto_aead_ctx(tfm);
744 crypto_free_aead(tfm);
749 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm);
759 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm);
771 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
772 struct cryptd_queue *queue = cryptd_get_queue(crypto_aead_tfm(tfm));
789 static int cryptd_aead_init_tfm(struct crypto_aead *tfm)
791 struct aead_instance *inst = aead_alg_instance(tfm);
794 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm);
803 tfm, max((unsigned)sizeof(struct cryptd_aead_request_ctx),
808 static void cryptd_aead_exit_tfm(struct crypto_aead *tfm)
810 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm);
910 struct crypto_skcipher *tfm;
916 tfm = crypto_alloc_skcipher(cryptd_alg_name, type, mask);
917 if (IS_ERR(tfm))
918 return ERR_CAST(tfm);
920 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) {
921 crypto_free_skcipher(tfm);
925 ctx = crypto_skcipher_ctx(tfm);
928 return container_of(tfm, struct cryptd_skcipher, base);
932 struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm)
934 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base);
940 bool cryptd_skcipher_queued(struct cryptd_skcipher *tfm)
942 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base);
948 void cryptd_free_skcipher(struct cryptd_skcipher *tfm)
950 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base);
953 crypto_free_skcipher(&tfm->base);
962 struct crypto_ahash *tfm;
967 tfm = crypto_alloc_ahash(cryptd_alg_name, type, mask);
968 if (IS_ERR(tfm))
969 return ERR_CAST(tfm);
970 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) {
971 crypto_free_ahash(tfm);
975 ctx = crypto_ahash_ctx(tfm);
978 return __cryptd_ahash_cast(tfm);
982 struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm)
984 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base);
997 bool cryptd_ahash_queued(struct cryptd_ahash *tfm)
999 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base);
1005 void cryptd_free_ahash(struct cryptd_ahash *tfm)
1007 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base);
1010 crypto_free_ahash(&tfm->base);
1019 struct crypto_aead *tfm;
1024 tfm = crypto_alloc_aead(cryptd_alg_name, type, mask);
1025 if (IS_ERR(tfm))
1026 return ERR_CAST(tfm);
1027 if (tfm->base.__crt_alg->cra_module != THIS_MODULE) {
1028 crypto_free_aead(tfm);
1032 ctx = crypto_aead_ctx(tfm);
1035 return __cryptd_aead_cast(tfm);
1039 struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm)
1042 ctx = crypto_aead_ctx(&tfm->base);
1047 bool cryptd_aead_queued(struct cryptd_aead *tfm)
1049 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base);
1055 void cryptd_free_aead(struct cryptd_aead *tfm)
1057 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base);
1060 crypto_free_aead(&tfm->base);