Lines Matching full: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. */
674 * POINT. Set them into X and Y. If one coordinate is not required,
676 * on success or !0 if POINT is at infinity.
678 int mpi_ec_get_affine(MPI x, MPI y, MPI_POINT point, struct mpi_ec_ctx *ctx) in mpi_ec_get_affine() argument
680 if (!mpi_cmp_ui(point->z, 0)) in mpi_ec_get_affine()
690 ec_invm(z1, point->z, ctx); /* z1 = z^(-1) mod p */ in mpi_ec_get_affine()
694 ec_mulm(x, point->x, z2, ctx); in mpi_ec_get_affine()
699 ec_mulm(y, point->y, z3, ctx); in mpi_ec_get_affine()
711 mpi_set(x, point->x); in mpi_ec_get_affine()
726 ec_invm(z, point->z, ctx); in mpi_ec_get_affine()
734 ctx->mulm(x, point->x, z, ctx); in mpi_ec_get_affine()
739 ctx->mulm(y, point->y, z, ctx); in mpi_ec_get_affine()
752 /* RESULT = 2 * POINT (Weierstrass version). */
754 MPI_POINT point, struct mpi_ec_ctx *ctx) in dup_point_weierstrass() argument
766 if (!mpi_cmp_ui(point->y, 0) || !mpi_cmp_ui(point->z, 0)) { in dup_point_weierstrass()
777 ec_pow2(t1, point->z, ctx); in dup_point_weierstrass()
778 ec_subm(l1, point->x, t1, ctx); in dup_point_weierstrass()
780 ec_addm(t2, point->x, t1, ctx); in dup_point_weierstrass()
786 ec_pow2(l1, point->x, ctx); in dup_point_weierstrass()
788 ec_powm(t1, point->z, mpi_const(MPI_C_FOUR), ctx); in dup_point_weierstrass()
793 ec_mulm(z3, point->y, point->z, ctx); in dup_point_weierstrass()
798 ec_pow2(t2, point->y, ctx); in dup_point_weierstrass()
799 ec_mulm(l2, t2, point->x, ctx); in dup_point_weierstrass()
830 /* RESULT = 2 * POINT (Montgomery version). */
832 MPI_POINT point, struct mpi_ec_ctx *ctx) in dup_point_montgomery() argument
835 (void)point; in dup_point_montgomery()
841 /* RESULT = 2 * POINT (Twisted Edwards version). */
843 MPI_POINT point, struct mpi_ec_ctx *ctx) in dup_point_edwards() argument
845 #define X1 (point->x) in dup_point_edwards()
846 #define Y1 (point->y) in dup_point_edwards()
847 #define Z1 (point->z) in dup_point_edwards()
913 /* RESULT = 2 * POINT */
915 mpi_ec_dup_point(MPI_POINT result, MPI_POINT point, struct mpi_ec_ctx *ctx) in mpi_ec_dup_point() argument
919 dup_point_weierstrass(result, point, ctx); in mpi_ec_dup_point()
922 dup_point_montgomery(result, point, ctx); in mpi_ec_dup_point()
925 dup_point_edwards(result, point, ctx); in mpi_ec_dup_point()
957 /* Same point; need to call the duplicate function. */ in add_points_weierstrass()
1159 /* Compute a step of Montgomery Ladder (only use X and Z in the point).
1206 /* Scalar point multiplication - the main function for ECC. If takes
1207 * an integer SCALAR and a POINT as well as the usual context CTX.
1208 * RESULT will be set to the resulting point.
1211 MPI scalar, MPI_POINT point, in mpi_ec_mul_point() argument
1237 point_resize(point, ctx); in mpi_ec_mul_point()
1240 point_resize(point, ctx); in mpi_ec_mul_point()
1245 mpi_ec_add_points(result, result, point, ctx); in mpi_ec_mul_point()
1256 /* Compute scalar point multiplication with Montgomery Ladder. in mpi_ec_mul_point()
1268 p2.x = mpi_copy(point->x); in mpi_ec_mul_point()
1276 mpi_resize(point->x, ctx->p->nlimbs); in mpi_ec_mul_point()
1277 point->x->nlimbs = ctx->p->nlimbs; in mpi_ec_mul_point()
1289 montgomery_ladder(prd, sum, q1, q2, point->x, ctx); in mpi_ec_mul_point()
1323 yy = mpi_copy(point->y); in mpi_ec_mul_point()
1330 if (!mpi_cmp_ui(point->z, 1)) { in mpi_ec_mul_point()
1331 mpi_set(x1, point->x); in mpi_ec_mul_point()
1338 ec_mulm(z2, point->z, point->z, ctx); in mpi_ec_mul_point()
1339 ec_mulm(z3, point->z, z2, ctx); in mpi_ec_mul_point()
1341 ec_mulm(x1, point->x, z2, ctx); in mpi_ec_mul_point()
1361 mpi_set(result->x, point->x); in mpi_ec_mul_point()
1363 mpi_set(result->z, point->z); in mpi_ec_mul_point()
1373 /* Invert point: y = p - y mod p */ in mpi_ec_mul_point()
1397 /* Return true if POINT is on the curve described by CTX. */
1398 int mpi_ec_curve_point(MPI_POINT point, struct mpi_ec_ctx *ctx) in mpi_ec_curve_point() argument
1407 /* Check that the point is in range. This needs to be done here and in mpi_ec_curve_point()
1410 if (mpi_cmpabs(point->x, ctx->p) >= 0) in mpi_ec_curve_point()
1412 if (mpi_cmpabs(point->y, ctx->p) >= 0) in mpi_ec_curve_point()
1414 if (mpi_cmpabs(point->z, ctx->p) >= 0) in mpi_ec_curve_point()
1422 if (mpi_ec_get_affine(x, y, point, ctx)) in mpi_ec_curve_point()
1446 if (mpi_ec_get_affine(x, NULL, point, ctx)) in mpi_ec_curve_point()
1476 if (mpi_ec_get_affine(x, y, point, ctx)) in mpi_ec_curve_point()