Lines Matching defs:ecdh
7 #include <crypto/ecdh.h>
126 struct hpre_ecdh_ctx ecdh;
141 struct kpp_request *ecdh;
1218 if (is_ecdh && ctx->ecdh.p) {
1219 /* ecdh: p->a->k->b */
1220 memzero_explicit(ctx->ecdh.p + shift, sz);
1221 dma_free_coherent(dev, sz << 3, ctx->ecdh.p, ctx->ecdh.dma_p);
1222 ctx->ecdh.p = NULL;
1270 static int hpre_ecdh_fill_curve(struct hpre_ctx *ctx, struct ecdh *params,
1275 void *p = ctx->ecdh.p + ctx->key_sz - cur_sz;
1276 void *a = ctx->ecdh.p + shifta - cur_sz;
1277 void *b = ctx->ecdh.p + shiftb - cur_sz;
1278 void *x = ctx->ecdh.g + ctx->key_sz - cur_sz;
1279 void *y = ctx->ecdh.g + shifta - cur_sz;
1322 static int hpre_ecdh_set_param(struct hpre_ctx *ctx, struct ecdh *params)
1338 if (!ctx->ecdh.p) {
1339 ctx->ecdh.p = dma_alloc_coherent(dev, sz << 3, &ctx->ecdh.dma_p,
1341 if (!ctx->ecdh.p)
1346 ctx->ecdh.g = ctx->ecdh.p + shift;
1347 ctx->ecdh.dma_g = ctx->ecdh.dma_p + shift;
1352 dma_free_coherent(dev, sz << 3, ctx->ecdh.p, ctx->ecdh.dma_p);
1353 ctx->ecdh.p = NULL;
1371 static int ecdh_gen_privkey(struct hpre_ctx *ctx, struct ecdh *params)
1398 struct ecdh params;
1402 dev_err(dev, "failed to decode ecdh key!\n");
1436 memcpy(ctx->ecdh.p + sz_shift, params.key, params.key_size);
1478 areq = req->areq.ecdh;
1511 h_req->areq.ecdh = req;
1516 msg->key = cpu_to_le64(ctx->ecdh.dma_p);
1596 dev_err(dev, "failed to set ecdh request, ret = %d!\n", ret);
1607 msg->in = cpu_to_le64(ctx->ecdh.dma_g);
2049 .cra_name = "ecdh-nist-p192",
2050 .cra_driver_name = "hpre-ecdh-nist-p192",
2063 .cra_name = "ecdh-nist-p256",
2064 .cra_driver_name = "hpre-ecdh-nist-p256",
2077 .cra_name = "ecdh-nist-p384",
2078 .cra_driver_name = "hpre-ecdh-nist-p384",