Lines Matching full:pdb
62 struct rsa_pub_pdb *pdb = &edesc->pdb.pub; in rsa_pub_unmap() local
64 dma_unmap_single(dev, pdb->n_dma, key->n_sz, DMA_TO_DEVICE); in rsa_pub_unmap()
65 dma_unmap_single(dev, pdb->e_dma, key->e_sz, DMA_TO_DEVICE); in rsa_pub_unmap()
74 struct rsa_priv_f1_pdb *pdb = &edesc->pdb.priv_f1; in rsa_priv_f1_unmap() local
76 dma_unmap_single(dev, pdb->n_dma, key->n_sz, DMA_TO_DEVICE); in rsa_priv_f1_unmap()
77 dma_unmap_single(dev, pdb->d_dma, key->d_sz, DMA_TO_DEVICE); in rsa_priv_f1_unmap()
86 struct rsa_priv_f2_pdb *pdb = &edesc->pdb.priv_f2; in rsa_priv_f2_unmap() local
90 dma_unmap_single(dev, pdb->d_dma, key->d_sz, DMA_TO_DEVICE); in rsa_priv_f2_unmap()
91 dma_unmap_single(dev, pdb->p_dma, p_sz, DMA_TO_DEVICE); in rsa_priv_f2_unmap()
92 dma_unmap_single(dev, pdb->q_dma, q_sz, DMA_TO_DEVICE); in rsa_priv_f2_unmap()
93 dma_unmap_single(dev, pdb->tmp1_dma, p_sz, DMA_BIDIRECTIONAL); in rsa_priv_f2_unmap()
94 dma_unmap_single(dev, pdb->tmp2_dma, q_sz, DMA_BIDIRECTIONAL); in rsa_priv_f2_unmap()
103 struct rsa_priv_f3_pdb *pdb = &edesc->pdb.priv_f3; in rsa_priv_f3_unmap() local
107 dma_unmap_single(dev, pdb->p_dma, p_sz, DMA_TO_DEVICE); in rsa_priv_f3_unmap()
108 dma_unmap_single(dev, pdb->q_dma, q_sz, DMA_TO_DEVICE); in rsa_priv_f3_unmap()
109 dma_unmap_single(dev, pdb->dp_dma, p_sz, DMA_TO_DEVICE); in rsa_priv_f3_unmap()
110 dma_unmap_single(dev, pdb->dq_dma, q_sz, DMA_TO_DEVICE); in rsa_priv_f3_unmap()
111 dma_unmap_single(dev, pdb->c_dma, p_sz, DMA_TO_DEVICE); in rsa_priv_f3_unmap()
112 dma_unmap_single(dev, pdb->tmp1_dma, p_sz, DMA_BIDIRECTIONAL); in rsa_priv_f3_unmap()
113 dma_unmap_single(dev, pdb->tmp2_dma, q_sz, DMA_BIDIRECTIONAL); in rsa_priv_f3_unmap()
403 struct rsa_pub_pdb *pdb = &edesc->pdb.pub; in set_rsa_pub_pdb() local
406 pdb->n_dma = dma_map_single(dev, key->n, key->n_sz, DMA_TO_DEVICE); in set_rsa_pub_pdb()
407 if (dma_mapping_error(dev, pdb->n_dma)) { in set_rsa_pub_pdb()
412 pdb->e_dma = dma_map_single(dev, key->e, key->e_sz, DMA_TO_DEVICE); in set_rsa_pub_pdb()
413 if (dma_mapping_error(dev, pdb->e_dma)) { in set_rsa_pub_pdb()
415 dma_unmap_single(dev, pdb->n_dma, key->n_sz, DMA_TO_DEVICE); in set_rsa_pub_pdb()
420 pdb->sgf |= RSA_PDB_SGF_F; in set_rsa_pub_pdb()
421 pdb->f_dma = edesc->sec4_sg_dma; in set_rsa_pub_pdb()
424 pdb->f_dma = sg_dma_address(req_ctx->fixup_src); in set_rsa_pub_pdb()
428 pdb->sgf |= RSA_PDB_SGF_G; in set_rsa_pub_pdb()
429 pdb->g_dma = edesc->sec4_sg_dma + in set_rsa_pub_pdb()
432 pdb->g_dma = sg_dma_address(req->dst); in set_rsa_pub_pdb()
435 pdb->sgf |= (key->e_sz << RSA_PDB_E_SHIFT) | key->n_sz; in set_rsa_pub_pdb()
436 pdb->f_len = req_ctx->fixup_src_len; in set_rsa_pub_pdb()
448 struct rsa_priv_f1_pdb *pdb = &edesc->pdb.priv_f1; in set_rsa_priv_f1_pdb() local
451 pdb->n_dma = dma_map_single(dev, key->n, key->n_sz, DMA_TO_DEVICE); in set_rsa_priv_f1_pdb()
452 if (dma_mapping_error(dev, pdb->n_dma)) { in set_rsa_priv_f1_pdb()
457 pdb->d_dma = dma_map_single(dev, key->d, key->d_sz, DMA_TO_DEVICE); in set_rsa_priv_f1_pdb()
458 if (dma_mapping_error(dev, pdb->d_dma)) { in set_rsa_priv_f1_pdb()
460 dma_unmap_single(dev, pdb->n_dma, key->n_sz, DMA_TO_DEVICE); in set_rsa_priv_f1_pdb()
465 pdb->sgf |= RSA_PRIV_PDB_SGF_G; in set_rsa_priv_f1_pdb()
466 pdb->g_dma = edesc->sec4_sg_dma; in set_rsa_priv_f1_pdb()
472 pdb->g_dma = sg_dma_address(req_ctx->fixup_src); in set_rsa_priv_f1_pdb()
476 pdb->sgf |= RSA_PRIV_PDB_SGF_F; in set_rsa_priv_f1_pdb()
477 pdb->f_dma = edesc->sec4_sg_dma + in set_rsa_priv_f1_pdb()
480 pdb->f_dma = sg_dma_address(req->dst); in set_rsa_priv_f1_pdb()
483 pdb->sgf |= (key->d_sz << RSA_PDB_D_SHIFT) | key->n_sz; in set_rsa_priv_f1_pdb()
495 struct rsa_priv_f2_pdb *pdb = &edesc->pdb.priv_f2; in set_rsa_priv_f2_pdb() local
500 pdb->d_dma = dma_map_single(dev, key->d, key->d_sz, DMA_TO_DEVICE); in set_rsa_priv_f2_pdb()
501 if (dma_mapping_error(dev, pdb->d_dma)) { in set_rsa_priv_f2_pdb()
506 pdb->p_dma = dma_map_single(dev, key->p, p_sz, DMA_TO_DEVICE); in set_rsa_priv_f2_pdb()
507 if (dma_mapping_error(dev, pdb->p_dma)) { in set_rsa_priv_f2_pdb()
512 pdb->q_dma = dma_map_single(dev, key->q, q_sz, DMA_TO_DEVICE); in set_rsa_priv_f2_pdb()
513 if (dma_mapping_error(dev, pdb->q_dma)) { in set_rsa_priv_f2_pdb()
518 pdb->tmp1_dma = dma_map_single(dev, key->tmp1, p_sz, DMA_BIDIRECTIONAL); in set_rsa_priv_f2_pdb()
519 if (dma_mapping_error(dev, pdb->tmp1_dma)) { in set_rsa_priv_f2_pdb()
524 pdb->tmp2_dma = dma_map_single(dev, key->tmp2, q_sz, DMA_BIDIRECTIONAL); in set_rsa_priv_f2_pdb()
525 if (dma_mapping_error(dev, pdb->tmp2_dma)) { in set_rsa_priv_f2_pdb()
531 pdb->sgf |= RSA_PRIV_PDB_SGF_G; in set_rsa_priv_f2_pdb()
532 pdb->g_dma = edesc->sec4_sg_dma; in set_rsa_priv_f2_pdb()
537 pdb->g_dma = sg_dma_address(req_ctx->fixup_src); in set_rsa_priv_f2_pdb()
541 pdb->sgf |= RSA_PRIV_PDB_SGF_F; in set_rsa_priv_f2_pdb()
542 pdb->f_dma = edesc->sec4_sg_dma + in set_rsa_priv_f2_pdb()
545 pdb->f_dma = sg_dma_address(req->dst); in set_rsa_priv_f2_pdb()
548 pdb->sgf |= (key->d_sz << RSA_PDB_D_SHIFT) | key->n_sz; in set_rsa_priv_f2_pdb()
549 pdb->p_q_len = (q_sz << RSA_PDB_Q_SHIFT) | p_sz; in set_rsa_priv_f2_pdb()
554 dma_unmap_single(dev, pdb->tmp1_dma, p_sz, DMA_BIDIRECTIONAL); in set_rsa_priv_f2_pdb()
556 dma_unmap_single(dev, pdb->q_dma, q_sz, DMA_TO_DEVICE); in set_rsa_priv_f2_pdb()
558 dma_unmap_single(dev, pdb->p_dma, p_sz, DMA_TO_DEVICE); in set_rsa_priv_f2_pdb()
560 dma_unmap_single(dev, pdb->d_dma, key->d_sz, DMA_TO_DEVICE); in set_rsa_priv_f2_pdb()
572 struct rsa_priv_f3_pdb *pdb = &edesc->pdb.priv_f3; in set_rsa_priv_f3_pdb() local
577 pdb->p_dma = dma_map_single(dev, key->p, p_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
578 if (dma_mapping_error(dev, pdb->p_dma)) { in set_rsa_priv_f3_pdb()
583 pdb->q_dma = dma_map_single(dev, key->q, q_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
584 if (dma_mapping_error(dev, pdb->q_dma)) { in set_rsa_priv_f3_pdb()
589 pdb->dp_dma = dma_map_single(dev, key->dp, p_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
590 if (dma_mapping_error(dev, pdb->dp_dma)) { in set_rsa_priv_f3_pdb()
595 pdb->dq_dma = dma_map_single(dev, key->dq, q_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
596 if (dma_mapping_error(dev, pdb->dq_dma)) { in set_rsa_priv_f3_pdb()
601 pdb->c_dma = dma_map_single(dev, key->qinv, p_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
602 if (dma_mapping_error(dev, pdb->c_dma)) { in set_rsa_priv_f3_pdb()
607 pdb->tmp1_dma = dma_map_single(dev, key->tmp1, p_sz, DMA_BIDIRECTIONAL); in set_rsa_priv_f3_pdb()
608 if (dma_mapping_error(dev, pdb->tmp1_dma)) { in set_rsa_priv_f3_pdb()
613 pdb->tmp2_dma = dma_map_single(dev, key->tmp2, q_sz, DMA_BIDIRECTIONAL); in set_rsa_priv_f3_pdb()
614 if (dma_mapping_error(dev, pdb->tmp2_dma)) { in set_rsa_priv_f3_pdb()
620 pdb->sgf |= RSA_PRIV_PDB_SGF_G; in set_rsa_priv_f3_pdb()
621 pdb->g_dma = edesc->sec4_sg_dma; in set_rsa_priv_f3_pdb()
626 pdb->g_dma = sg_dma_address(req_ctx->fixup_src); in set_rsa_priv_f3_pdb()
630 pdb->sgf |= RSA_PRIV_PDB_SGF_F; in set_rsa_priv_f3_pdb()
631 pdb->f_dma = edesc->sec4_sg_dma + in set_rsa_priv_f3_pdb()
634 pdb->f_dma = sg_dma_address(req->dst); in set_rsa_priv_f3_pdb()
637 pdb->sgf |= key->n_sz; in set_rsa_priv_f3_pdb()
638 pdb->p_q_len = (q_sz << RSA_PDB_Q_SHIFT) | p_sz; in set_rsa_priv_f3_pdb()
643 dma_unmap_single(dev, pdb->tmp1_dma, p_sz, DMA_BIDIRECTIONAL); in set_rsa_priv_f3_pdb()
645 dma_unmap_single(dev, pdb->c_dma, p_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
647 dma_unmap_single(dev, pdb->dq_dma, q_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
649 dma_unmap_single(dev, pdb->dp_dma, p_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
651 dma_unmap_single(dev, pdb->q_dma, q_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
653 dma_unmap_single(dev, pdb->p_dma, p_sz, DMA_TO_DEVICE); in set_rsa_priv_f3_pdb()
734 init_rsa_pub_desc(edesc->hw_desc, &edesc->pdb.pub); in caam_rsa_enc()
763 init_rsa_priv_f1_desc(edesc->hw_desc, &edesc->pdb.priv_f1); in caam_rsa_dec_priv_f1()
792 init_rsa_priv_f2_desc(edesc->hw_desc, &edesc->pdb.priv_f2); in caam_rsa_dec_priv_f2()
821 init_rsa_priv_f3_desc(edesc->hw_desc, &edesc->pdb.priv_f3); in caam_rsa_dec_priv_f3()