Lines Matching refs:point
305 int ec_GF2m_simple_point_init(EC_POINT *point) in ec_GF2m_simple_point_init() argument
307 BN_init(&point->X); in ec_GF2m_simple_point_init()
308 BN_init(&point->Y); in ec_GF2m_simple_point_init()
309 BN_init(&point->Z); in ec_GF2m_simple_point_init()
315 void ec_GF2m_simple_point_finish(EC_POINT *point) in ec_GF2m_simple_point_finish() argument
317 BN_free(&point->X); in ec_GF2m_simple_point_finish()
318 BN_free(&point->Y); in ec_GF2m_simple_point_finish()
319 BN_free(&point->Z); in ec_GF2m_simple_point_finish()
324 void ec_GF2m_simple_point_clear_finish(EC_POINT *point) in ec_GF2m_simple_point_clear_finish() argument
326 BN_clear_free(&point->X); in ec_GF2m_simple_point_clear_finish()
327 BN_clear_free(&point->Y); in ec_GF2m_simple_point_clear_finish()
328 BN_clear_free(&point->Z); in ec_GF2m_simple_point_clear_finish()
329 point->Z_is_one = 0; in ec_GF2m_simple_point_clear_finish()
348 int ec_GF2m_simple_point_set_to_infinity(const EC_GROUP *group, EC_POINT *point) in ec_GF2m_simple_point_set_to_infinity() argument
350 point->Z_is_one = 0; in ec_GF2m_simple_point_set_to_infinity()
351 BN_zero(&point->Z); in ec_GF2m_simple_point_set_to_infinity()
359 int ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group, EC_POINT *point, in ec_GF2m_simple_point_set_affine_coordinates() argument
369 if (!BN_copy(&point->X, x)) goto err; in ec_GF2m_simple_point_set_affine_coordinates()
370 BN_set_negative(&point->X, 0); in ec_GF2m_simple_point_set_affine_coordinates()
371 if (!BN_copy(&point->Y, y)) goto err; in ec_GF2m_simple_point_set_affine_coordinates()
372 BN_set_negative(&point->Y, 0); in ec_GF2m_simple_point_set_affine_coordinates()
373 if (!BN_copy(&point->Z, BN_value_one())) goto err; in ec_GF2m_simple_point_set_affine_coordinates()
374 BN_set_negative(&point->Z, 0); in ec_GF2m_simple_point_set_affine_coordinates()
375 point->Z_is_one = 1; in ec_GF2m_simple_point_set_affine_coordinates()
386 int ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point, in ec_GF2m_simple_point_get_affine_coordinates() argument
391 if (EC_POINT_is_at_infinity(group, point)) in ec_GF2m_simple_point_get_affine_coordinates()
397 if (BN_cmp(&point->Z, BN_value_one())) in ec_GF2m_simple_point_get_affine_coordinates()
404 if (!BN_copy(x, &point->X)) goto err; in ec_GF2m_simple_point_get_affine_coordinates()
409 if (!BN_copy(y, &point->Y)) goto err; in ec_GF2m_simple_point_get_affine_coordinates()
529 int ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) in ec_GF2m_simple_invert() argument
531 if (EC_POINT_is_at_infinity(group, point) || BN_is_zero(&point->Y)) in ec_GF2m_simple_invert()
535 if (!EC_POINT_make_affine(group, point, ctx)) return 0; in ec_GF2m_simple_invert()
536 return BN_GF2m_add(&point->Y, &point->X, &point->Y); in ec_GF2m_simple_invert()
541 int ec_GF2m_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) in ec_GF2m_simple_is_at_infinity() argument
543 return BN_is_zero(&point->Z); in ec_GF2m_simple_is_at_infinity()
551 int ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx) in ec_GF2m_simple_is_on_curve() argument
559 if (EC_POINT_is_at_infinity(group, point)) in ec_GF2m_simple_is_on_curve()
566 if (!point->Z_is_one) return -1; in ec_GF2m_simple_is_on_curve()
585 if (!BN_GF2m_add(lh, &point->X, &group->a)) goto err; in ec_GF2m_simple_is_on_curve()
586 if (!field_mul(group, lh, lh, &point->X, ctx)) goto err; in ec_GF2m_simple_is_on_curve()
587 if (!BN_GF2m_add(lh, lh, &point->Y)) goto err; in ec_GF2m_simple_is_on_curve()
588 if (!field_mul(group, lh, lh, &point->X, ctx)) goto err; in ec_GF2m_simple_is_on_curve()
590 if (!field_sqr(group, y2, &point->Y, ctx)) goto err; in ec_GF2m_simple_is_on_curve()
651 int ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) in ec_GF2m_simple_make_affine() argument
657 if (point->Z_is_one || EC_POINT_is_at_infinity(group, point)) in ec_GF2m_simple_make_affine()
672 if (!EC_POINT_get_affine_coordinates_GF2m(group, point, x, y, ctx)) goto err; in ec_GF2m_simple_make_affine()
673 if (!BN_copy(&point->X, x)) goto err; in ec_GF2m_simple_make_affine()
674 if (!BN_copy(&point->Y, y)) goto err; in ec_GF2m_simple_make_affine()
675 if (!BN_one(&point->Z)) goto err; in ec_GF2m_simple_make_affine()