Lines Matching refs:point

33 /* Create a new point option.  NBITS gives the size in bits of one
50 /* Release the point object P. P may be NULL. */
60 /* Initialize the fields of a point object. gcry_mpi_point_free_parts
71 /* Release the parts of a point object. */
681 int mpi_ec_get_affine(MPI x, MPI y, MPI_POINT point, struct mpi_ec_ctx *ctx)
683 if (!mpi_cmp_ui(point->z, 0))
693 ec_invm(z1, point->z, ctx); /* z1 = z^(-1) mod p */
697 ec_mulm(x, point->x, z2, ctx);
702 ec_mulm(y, point->y, z3, ctx);
714 mpi_set(x, point->x);
729 ec_invm(z, point->z, ctx);
737 ctx->mulm(x, point->x, z, ctx);
742 ctx->mulm(y, point->y, z, ctx);
757 MPI_POINT point, struct mpi_ec_ctx *ctx)
769 if (!mpi_cmp_ui(point->y, 0) || !mpi_cmp_ui(point->z, 0)) {
780 ec_pow2(t1, point->z, ctx);
781 ec_subm(l1, point->x, t1, ctx);
783 ec_addm(t2, point->x, t1, ctx);
789 ec_pow2(l1, point->x, ctx);
791 ec_powm(t1, point->z, mpi_const(MPI_C_FOUR), ctx);
796 ec_mulm(z3, point->y, point->z, ctx);
801 ec_pow2(t2, point->y, ctx);
802 ec_mulm(l2, t2, point->x, ctx);
835 MPI_POINT point, struct mpi_ec_ctx *ctx)
838 (void)point;
846 MPI_POINT point, struct mpi_ec_ctx *ctx)
848 #define X1 (point->x)
849 #define Y1 (point->y)
850 #define Z1 (point->z)
918 mpi_ec_dup_point(MPI_POINT result, MPI_POINT point, struct mpi_ec_ctx *ctx)
922 dup_point_weierstrass(result, point, ctx);
925 dup_point_montgomery(result, point, ctx);
928 dup_point_edwards(result, point, ctx);
960 /* Same point; need to call the duplicate function. */
1162 /* Compute a step of Montgomery Ladder (only use X and Z in the point).
1209 /* Scalar point multiplication - the main function for ECC. If takes
1211 * RESULT will be set to the resulting point.
1214 MPI scalar, MPI_POINT point,
1240 point_resize(point, ctx);
1243 point_resize(point, ctx);
1248 mpi_ec_add_points(result, result, point, ctx);
1259 /* Compute scalar point multiplication with Montgomery Ladder.
1271 p2.x = mpi_copy(point->x);
1279 mpi_resize(point->x, ctx->p->nlimbs);
1280 point->x->nlimbs = ctx->p->nlimbs;
1292 montgomery_ladder(prd, sum, q1, q2, point->x, ctx);
1326 yy = mpi_copy(point->y);
1333 if (!mpi_cmp_ui(point->z, 1)) {
1334 mpi_set(x1, point->x);
1341 ec_mulm(z2, point->z, point->z, ctx);
1342 ec_mulm(z3, point->z, z2, ctx);
1344 ec_mulm(x1, point->x, z2, ctx);
1364 mpi_set(result->x, point->x);
1366 mpi_set(result->z, point->z);
1376 /* Invert point: y = p - y mod p */
1401 int mpi_ec_curve_point(MPI_POINT point, struct mpi_ec_ctx *ctx)
1410 /* Check that the point is in range. This needs to be done here and
1413 if (mpi_cmpabs(point->x, ctx->p) >= 0)
1415 if (mpi_cmpabs(point->y, ctx->p) >= 0)
1417 if (mpi_cmpabs(point->z, ctx->p) >= 0)
1425 if (mpi_ec_get_affine(x, y, point, ctx))
1449 if (mpi_ec_get_affine(x, NULL, point, ctx))
1479 if (mpi_ec_get_affine(x, y, point, ctx))