Lines Matching defs:dh
5 #include <crypto/dh.h>
128 struct hpre_dh_ctx dh;
143 struct kpp_request *dh;
297 /* when the data is dh's source, we should format it */
444 areq = req->areq.dh;
549 h_req->areq.dh = kreq;
552 msg->key = cpu_to_le64(ctx->dh.dma_xa_p);
611 msg->in = cpu_to_le64(ctx->dh.dma_g);
656 static int hpre_dh_set_params(struct hpre_ctx *ctx, struct dh *params)
669 ctx->dh.xa_p = dma_alloc_coherent(dev, sz << 1,
670 &ctx->dh.dma_xa_p, GFP_KERNEL);
671 if (!ctx->dh.xa_p)
674 memcpy(ctx->dh.xa_p + sz, params->p, sz);
682 ctx->dh.g = dma_alloc_coherent(dev, sz, &ctx->dh.dma_g, GFP_KERNEL);
683 if (!ctx->dh.g) {
684 dma_free_coherent(dev, sz << 1, ctx->dh.xa_p,
685 ctx->dh.dma_xa_p);
686 ctx->dh.xa_p = NULL;
690 memcpy(ctx->dh.g + (sz - params->g_size), params->g, params->g_size);
703 if (ctx->dh.g) {
704 dma_free_coherent(dev, sz, ctx->dh.g, ctx->dh.dma_g);
705 ctx->dh.g = NULL;
708 if (ctx->dh.xa_p) {
709 memzero_explicit(ctx->dh.xa_p, sz);
710 dma_free_coherent(dev, sz << 1, ctx->dh.xa_p,
711 ctx->dh.dma_xa_p);
712 ctx->dh.xa_p = NULL;
722 struct dh params;
735 memcpy(ctx->dh.xa_p + (ctx->key_sz - params.key_size), params.key,
2025 static struct kpp_alg dh = {
2035 .cra_name = "dh",
2036 .cra_driver_name = "hpre-dh",
2133 ret = crypto_register_kpp(&dh);
2135 dev_err(&qm->pdev->dev, "failed to register dh (%d)!\n", ret);
2145 crypto_unregister_kpp(&dh);