Lines Matching refs:req

255 	struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req);  in mv_process_current_q()  local
256 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in mv_process_current_q()
257 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_process_current_q()
270 memcpy(cpg->sram + SRAM_DATA_IV, req->info, 16); in mv_process_current_q()
310 struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req); in mv_crypto_algo_completion() local
311 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_crypto_algo_completion()
319 memcpy(req->info, cpg->sram + SRAM_DATA_IV_BUF, 16); in mv_crypto_algo_completion()
324 struct ahash_request *req = ahash_request_cast(cpg->cur_req); in mv_process_hash_current() local
325 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_process_hash_current()
326 struct mv_req_hash_ctx *req_ctx = ahash_request_ctx(req); in mv_process_hash_current()
401 static int mv_hash_final_fallback(struct ahash_request *req) in mv_hash_final_fallback() argument
403 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_hash_final_fallback()
404 struct mv_req_hash_ctx *req_ctx = ahash_request_ctx(req); in mv_hash_final_fallback()
421 rc = crypto_shash_final(shash, req->result); in mv_hash_final_fallback()
437 struct ahash_request *req = ahash_request_cast(cpg->cur_req); in mv_hash_algo_completion() local
438 struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); in mv_hash_algo_completion()
446 memcpy(req->result, cpg->sram + SRAM_DIGEST_BUF, in mv_hash_algo_completion()
448 (req))); in mv_hash_algo_completion()
451 mv_hash_final_fallback(req); in mv_hash_algo_completion()
460 struct crypto_async_request *req = cpg->cur_req; in dequeue_complete_req() local
503 req->complete(req, 0); in dequeue_complete_req()
525 static void mv_start_new_crypt_req(struct ablkcipher_request *req) in mv_start_new_crypt_req() argument
530 cpg->cur_req = &req->base; in mv_start_new_crypt_req()
532 p->hw_nbytes = req->nbytes; in mv_start_new_crypt_req()
537 num_sgs = count_sgs(req->src, req->nbytes); in mv_start_new_crypt_req()
538 sg_miter_start(&p->src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG); in mv_start_new_crypt_req()
540 num_sgs = count_sgs(req->dst, req->nbytes); in mv_start_new_crypt_req()
541 sg_miter_start(&p->dst_sg_it, req->dst, num_sgs, SG_MITER_TO_SG); in mv_start_new_crypt_req()
546 static void mv_start_new_hash_req(struct ahash_request *req) in mv_start_new_hash_req() argument
549 struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); in mv_start_new_hash_req()
551 cpg->cur_req = &req->base; in mv_start_new_hash_req()
553 hw_bytes = req->nbytes + ctx->extra_bytes; in mv_start_new_hash_req()
563 num_sgs = count_sgs(req->src, req->nbytes); in mv_start_new_hash_req()
564 sg_miter_start(&p->src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG); in mv_start_new_hash_req()
583 rc = mv_hash_final_fallback(req); in mv_start_new_hash_req()
588 req->base.complete(&req->base, rc); in mv_start_new_hash_req()
624 struct ablkcipher_request *req = in queue_manag() local
626 mv_start_new_crypt_req(req); in queue_manag()
628 struct ahash_request *req = in queue_manag() local
630 mv_start_new_hash_req(req); in queue_manag()
641 static int mv_handle_req(struct crypto_async_request *req) in mv_handle_req() argument
647 ret = crypto_enqueue_request(&cpg->queue, req); in mv_handle_req()
653 static int mv_enc_aes_ecb(struct ablkcipher_request *req) in mv_enc_aes_ecb() argument
655 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_enc_aes_ecb()
660 return mv_handle_req(&req->base); in mv_enc_aes_ecb()
663 static int mv_dec_aes_ecb(struct ablkcipher_request *req) in mv_dec_aes_ecb() argument
665 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in mv_dec_aes_ecb()
666 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_dec_aes_ecb()
672 return mv_handle_req(&req->base); in mv_dec_aes_ecb()
675 static int mv_enc_aes_cbc(struct ablkcipher_request *req) in mv_enc_aes_cbc() argument
677 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_enc_aes_cbc()
682 return mv_handle_req(&req->base); in mv_enc_aes_cbc()
685 static int mv_dec_aes_cbc(struct ablkcipher_request *req) in mv_dec_aes_cbc() argument
687 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in mv_dec_aes_cbc()
688 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_dec_aes_cbc()
694 return mv_handle_req(&req->base); in mv_dec_aes_cbc()
722 static int mv_hash_init(struct ahash_request *req) in mv_hash_init() argument
724 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_hash_init()
725 mv_init_hash_req_ctx(ahash_request_ctx(req), tfm_ctx->op, 0, 0, in mv_hash_init()
730 static int mv_hash_update(struct ahash_request *req) in mv_hash_update() argument
732 if (!req->nbytes) in mv_hash_update()
735 mv_update_hash_req_ctx(ahash_request_ctx(req), 0, req->nbytes); in mv_hash_update()
736 return mv_handle_req(&req->base); in mv_hash_update()
739 static int mv_hash_final(struct ahash_request *req) in mv_hash_final() argument
741 struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); in mv_hash_final()
743 ahash_request_set_crypt(req, NULL, req->result, 0); in mv_hash_final()
745 return mv_handle_req(&req->base); in mv_hash_final()
748 static int mv_hash_finup(struct ahash_request *req) in mv_hash_finup() argument
750 mv_update_hash_req_ctx(ahash_request_ctx(req), 1, req->nbytes); in mv_hash_finup()
751 return mv_handle_req(&req->base); in mv_hash_finup()
754 static int mv_hash_digest(struct ahash_request *req) in mv_hash_digest() argument
756 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_hash_digest()
757 mv_init_hash_req_ctx(ahash_request_ctx(req), tfm_ctx->op, 1, in mv_hash_digest()
758 req->nbytes, tfm_ctx->count_add); in mv_hash_digest()
759 return mv_handle_req(&req->base); in mv_hash_digest()