Lines Matching full:dh
4 #include <crypto/dh.h>
82 struct hpre_dh_ctx dh; member
93 struct kpp_request *dh; member
236 /* when the data is dh's source, we should format it */ in hpre_hw_data_init()
376 areq = req->areq.dh; in hpre_dh_cb()
471 h_req->areq.dh = kreq; in hpre_msg_request_set()
474 msg->key = cpu_to_le64(ctx->dh.dma_xa_p); in hpre_msg_request_set()
532 msg->in = cpu_to_le64(ctx->dh.dma_g); in hpre_dh_compute_value()
577 static int hpre_dh_set_params(struct hpre_ctx *ctx, struct dh *params) in hpre_dh_set_params()
590 ctx->dh.xa_p = dma_alloc_coherent(dev, sz << 1, in hpre_dh_set_params()
591 &ctx->dh.dma_xa_p, GFP_KERNEL); in hpre_dh_set_params()
592 if (!ctx->dh.xa_p) in hpre_dh_set_params()
595 memcpy(ctx->dh.xa_p + sz, params->p, sz); in hpre_dh_set_params()
603 ctx->dh.g = dma_alloc_coherent(dev, sz, &ctx->dh.dma_g, GFP_KERNEL); in hpre_dh_set_params()
604 if (!ctx->dh.g) { in hpre_dh_set_params()
605 dma_free_coherent(dev, sz << 1, ctx->dh.xa_p, in hpre_dh_set_params()
606 ctx->dh.dma_xa_p); in hpre_dh_set_params()
607 ctx->dh.xa_p = NULL; in hpre_dh_set_params()
611 memcpy(ctx->dh.g + (sz - params->g_size), params->g, params->g_size); in hpre_dh_set_params()
624 if (ctx->dh.g) { in hpre_dh_clear_ctx()
625 dma_free_coherent(dev, sz, ctx->dh.g, ctx->dh.dma_g); in hpre_dh_clear_ctx()
626 ctx->dh.g = NULL; in hpre_dh_clear_ctx()
629 if (ctx->dh.xa_p) { in hpre_dh_clear_ctx()
630 memzero_explicit(ctx->dh.xa_p, sz); in hpre_dh_clear_ctx()
631 dma_free_coherent(dev, sz << 1, ctx->dh.xa_p, in hpre_dh_clear_ctx()
632 ctx->dh.dma_xa_p); in hpre_dh_clear_ctx()
633 ctx->dh.xa_p = NULL; in hpre_dh_clear_ctx()
643 struct dh params; in hpre_dh_set_secret()
656 memcpy(ctx->dh.xa_p + (ctx->key_sz - params.key_size), params.key, in hpre_dh_set_secret()
1139 static struct kpp_alg dh = { variable
1150 .cra_name = "dh",
1151 .cra_driver_name = "hpre-dh",
1166 ret = crypto_register_kpp(&dh); in hpre_algs_register()
1178 crypto_unregister_kpp(&dh); in hpre_algs_unregister()