/* Do the ECDHE key exchange (part 2: computation of the shared secret from the point sent by the client).  */
static void do_ecdhe_part2(br_ssl_server_context *ctx, int prf_id, unsigned char *cpoint, size_t cpoint_len)
/* Do the ECDHE key exchange (part 2: computation of the shared secret from the point sent by the client).  */
static void do_ecdhe_part2(br_ssl_server_context *ctx, int prf_id, unsigned char *cpoint, size_t cpoint_len)
{
	int curve;
	uint32_t ctl;
	size_t xoff, xlen;
	curve = ctx->eng.ecdhe_curve;
	ctl = ctx->eng.iec->mul(cpoint, cpoint_len,
		ctx->ecdhe_key, ctx->ecdhe_key_len, curve);
	xoff = ctx->eng.iec->xoff(curve, &xlen);
	ecdh_common(ctx, prf_id, cpoint + xoff, xlen, ctl);
	memset(ctx->ecdhe_key, 0, ctx->ecdhe_key_len);
}