Lines Matching refs:req
260 struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req); in mv_process_current_q() local
261 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in mv_process_current_q()
262 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_process_current_q()
275 memcpy(cpg->sram + SRAM_DATA_IV, req->info, 16); in mv_process_current_q()
315 struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req); in mv_crypto_algo_completion() local
316 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_crypto_algo_completion()
324 memcpy(req->info, cpg->sram + SRAM_DATA_IV_BUF, 16); in mv_crypto_algo_completion()
329 struct ahash_request *req = ahash_request_cast(cpg->cur_req); in mv_process_hash_current() local
330 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_process_hash_current()
331 struct mv_req_hash_ctx *req_ctx = ahash_request_ctx(req); in mv_process_hash_current()
406 static int mv_hash_final_fallback(struct ahash_request *req) in mv_hash_final_fallback() argument
408 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_hash_final_fallback()
409 struct mv_req_hash_ctx *req_ctx = ahash_request_ctx(req); in mv_hash_final_fallback()
426 rc = crypto_shash_final(shash, req->result); in mv_hash_final_fallback()
442 struct ahash_request *req = ahash_request_cast(cpg->cur_req); in mv_hash_algo_completion() local
443 struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); in mv_hash_algo_completion()
451 memcpy(req->result, cpg->sram + SRAM_DIGEST_BUF, in mv_hash_algo_completion()
453 (req))); in mv_hash_algo_completion()
456 mv_hash_final_fallback(req); in mv_hash_algo_completion()
465 struct crypto_async_request *req = cpg->cur_req; in dequeue_complete_req() local
508 req->complete(req, 0); in dequeue_complete_req()
530 static void mv_start_new_crypt_req(struct ablkcipher_request *req) in mv_start_new_crypt_req() argument
535 cpg->cur_req = &req->base; in mv_start_new_crypt_req()
537 p->hw_nbytes = req->nbytes; in mv_start_new_crypt_req()
542 num_sgs = count_sgs(req->src, req->nbytes); in mv_start_new_crypt_req()
543 sg_miter_start(&p->src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG); in mv_start_new_crypt_req()
545 num_sgs = count_sgs(req->dst, req->nbytes); in mv_start_new_crypt_req()
546 sg_miter_start(&p->dst_sg_it, req->dst, num_sgs, SG_MITER_TO_SG); in mv_start_new_crypt_req()
551 static void mv_start_new_hash_req(struct ahash_request *req) in mv_start_new_hash_req() argument
554 struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); in mv_start_new_hash_req()
556 cpg->cur_req = &req->base; in mv_start_new_hash_req()
558 hw_bytes = req->nbytes + ctx->extra_bytes; in mv_start_new_hash_req()
568 num_sgs = count_sgs(req->src, req->nbytes); in mv_start_new_hash_req()
569 sg_miter_start(&p->src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG); in mv_start_new_hash_req()
588 rc = mv_hash_final_fallback(req); in mv_start_new_hash_req()
593 req->base.complete(&req->base, rc); in mv_start_new_hash_req()
629 struct ablkcipher_request *req = in queue_manag() local
631 mv_start_new_crypt_req(req); in queue_manag()
633 struct ahash_request *req = in queue_manag() local
635 mv_start_new_hash_req(req); in queue_manag()
646 static int mv_handle_req(struct crypto_async_request *req) in mv_handle_req() argument
652 ret = crypto_enqueue_request(&cpg->queue, req); in mv_handle_req()
658 static int mv_enc_aes_ecb(struct ablkcipher_request *req) in mv_enc_aes_ecb() argument
660 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_enc_aes_ecb()
665 return mv_handle_req(&req->base); in mv_enc_aes_ecb()
668 static int mv_dec_aes_ecb(struct ablkcipher_request *req) in mv_dec_aes_ecb() argument
670 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in mv_dec_aes_ecb()
671 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_dec_aes_ecb()
677 return mv_handle_req(&req->base); in mv_dec_aes_ecb()
680 static int mv_enc_aes_cbc(struct ablkcipher_request *req) in mv_enc_aes_cbc() argument
682 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_enc_aes_cbc()
687 return mv_handle_req(&req->base); in mv_enc_aes_cbc()
690 static int mv_dec_aes_cbc(struct ablkcipher_request *req) in mv_dec_aes_cbc() argument
692 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in mv_dec_aes_cbc()
693 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); in mv_dec_aes_cbc()
699 return mv_handle_req(&req->base); in mv_dec_aes_cbc()
727 static int mv_hash_init(struct ahash_request *req) in mv_hash_init() argument
729 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_hash_init()
730 mv_init_hash_req_ctx(ahash_request_ctx(req), tfm_ctx->op, 0, 0, in mv_hash_init()
735 static int mv_hash_update(struct ahash_request *req) in mv_hash_update() argument
737 if (!req->nbytes) in mv_hash_update()
740 mv_update_hash_req_ctx(ahash_request_ctx(req), 0, req->nbytes); in mv_hash_update()
741 return mv_handle_req(&req->base); in mv_hash_update()
744 static int mv_hash_final(struct ahash_request *req) in mv_hash_final() argument
746 struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); in mv_hash_final()
748 ahash_request_set_crypt(req, NULL, req->result, 0); in mv_hash_final()
750 return mv_handle_req(&req->base); in mv_hash_final()
753 static int mv_hash_finup(struct ahash_request *req) in mv_hash_finup() argument
755 mv_update_hash_req_ctx(ahash_request_ctx(req), 1, req->nbytes); in mv_hash_finup()
756 return mv_handle_req(&req->base); in mv_hash_finup()
759 static int mv_hash_digest(struct ahash_request *req) in mv_hash_digest() argument
761 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_hash_digest()
762 mv_init_hash_req_ctx(ahash_request_ctx(req), tfm_ctx->op, 1, in mv_hash_digest()
763 req->nbytes, tfm_ctx->count_add); in mv_hash_digest()
764 return mv_handle_req(&req->base); in mv_hash_digest()