Lines Matching full:dh
5 #include <crypto/dh.h>
130 struct hpre_dh_ctx dh;
147 struct kpp_request *dh;
301 /* when the data is dh's source, we should format it */
448 areq = req->areq.dh;
553 h_req->areq.dh = kreq;
556 msg->key = cpu_to_le64(ctx->dh.dma_xa_p);
617 msg->in = cpu_to_le64(ctx->dh.dma_g);
662 static int hpre_dh_set_params(struct hpre_ctx *ctx, struct dh *params)
675 ctx->dh.xa_p = dma_alloc_coherent(dev, sz << 1,
676 &ctx->dh.dma_xa_p, GFP_KERNEL);
677 if (!ctx->dh.xa_p)
680 memcpy(ctx->dh.xa_p + sz, params->p, sz);
688 ctx->dh.g = dma_alloc_coherent(dev, sz, &ctx->dh.dma_g, GFP_KERNEL);
689 if (!ctx->dh.g) {
690 dma_free_coherent(dev, sz << 1, ctx->dh.xa_p,
691 ctx->dh.dma_xa_p);
692 ctx->dh.xa_p = NULL;
696 memcpy(ctx->dh.g + (sz - params->g_size), params->g, params->g_size);
709 if (ctx->dh.g) {
710 dma_free_coherent(dev, sz, ctx->dh.g, ctx->dh.dma_g);
711 ctx->dh.g = NULL;
714 if (ctx->dh.xa_p) {
715 memzero_explicit(ctx->dh.xa_p, sz);
716 dma_free_coherent(dev, sz << 1, ctx->dh.xa_p,
717 ctx->dh.dma_xa_p);
718 ctx->dh.xa_p = NULL;
728 struct dh params;
741 memcpy(ctx->dh.xa_p + (ctx->key_sz - params.key_size), params.key,
2036 static struct kpp_alg dh = {
2046 .cra_name = "dh",
2047 .cra_driver_name = "hpre-dh",
2144 ret = crypto_register_kpp(&dh);
2146 dev_err(&qm->pdev->dev, "failed to register dh (%d)!\n", ret);
2156 crypto_unregister_kpp(&dh);