Lines Matching defs:ecdh

7 #include <crypto/ecdh.h>
129 struct hpre_ecdh_ctx ecdh;
144 struct kpp_request *ecdh;
1221 if (is_ecdh && ctx->ecdh.p) {
1222 /* ecdh: p->a->k->b */
1223 memzero_explicit(ctx->ecdh.p + shift, sz);
1224 dma_free_coherent(dev, sz << 3, ctx->ecdh.p, ctx->ecdh.dma_p);
1225 ctx->ecdh.p = NULL;
1273 static int hpre_ecdh_fill_curve(struct hpre_ctx *ctx, struct ecdh *params,
1278 void *p = ctx->ecdh.p + ctx->key_sz - cur_sz;
1279 void *a = ctx->ecdh.p + shifta - cur_sz;
1280 void *b = ctx->ecdh.p + shiftb - cur_sz;
1281 void *x = ctx->ecdh.g + ctx->key_sz - cur_sz;
1282 void *y = ctx->ecdh.g + shifta - cur_sz;
1325 static int hpre_ecdh_set_param(struct hpre_ctx *ctx, struct ecdh *params)
1341 if (!ctx->ecdh.p) {
1342 ctx->ecdh.p = dma_alloc_coherent(dev, sz << 3, &ctx->ecdh.dma_p,
1344 if (!ctx->ecdh.p)
1349 ctx->ecdh.g = ctx->ecdh.p + shift;
1350 ctx->ecdh.dma_g = ctx->ecdh.dma_p + shift;
1355 dma_free_coherent(dev, sz << 3, ctx->ecdh.p, ctx->ecdh.dma_p);
1356 ctx->ecdh.p = NULL;
1374 static int ecdh_gen_privkey(struct hpre_ctx *ctx, struct ecdh *params)
1401 struct ecdh params;
1405 dev_err(dev, "failed to decode ecdh key!\n");
1439 memcpy(ctx->ecdh.p + sz_shift, params.key, params.key_size);
1481 areq = req->areq.ecdh;
1514 h_req->areq.ecdh = req;
1519 msg->key = cpu_to_le64(ctx->ecdh.dma_p);
1599 dev_err(dev, "failed to set ecdh request, ret = %d!\n", ret);
1610 msg->in = cpu_to_le64(ctx->ecdh.dma_g);
2052 .cra_name = "ecdh-nist-p192",
2053 .cra_driver_name = "hpre-ecdh-nist-p192",
2066 .cra_name = "ecdh-nist-p256",
2067 .cra_driver_name = "hpre-ecdh-nist-p256",
2080 .cra_name = "ecdh-nist-p384",
2081 .cra_driver_name = "hpre-ecdh-nist-p384",