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