Lines Matching refs:group
374 int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, in EC_GROUP_set_generator() argument
376 if (group->curve_name != NID_undef) { in EC_GROUP_set_generator()
382 if (group->generator == NULL) { in EC_GROUP_set_generator()
383 group->generator = EC_POINT_new(group); in EC_GROUP_set_generator()
384 if (group->generator == NULL) { in EC_GROUP_set_generator()
389 if (!EC_POINT_copy(group->generator, generator)) { in EC_GROUP_set_generator()
394 if (!BN_copy(&group->order, order)) { in EC_GROUP_set_generator()
398 BN_zero(&group->order); in EC_GROUP_set_generator()
402 if (!BN_copy(&group->cofactor, cofactor)) { in EC_GROUP_set_generator()
406 BN_zero(&group->cofactor); in EC_GROUP_set_generator()
414 EC_GROUP *group = NULL; in ec_group_new_from_data() local
439 if (((group = ec_group_new(meth)) == NULL) || in ec_group_new_from_data()
440 (!(group->meth->group_set_curve(group, p, a, b, ctx)))) { in ec_group_new_from_data()
445 if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) { in ec_group_new_from_data()
451 if ((P = EC_POINT_new(group)) == NULL) { in ec_group_new_from_data()
462 if (!EC_POINT_set_affine_coordinates_GFp(group, P, x, y, ctx)) { in ec_group_new_from_data()
466 if (!BN_bin2bn(params + 5 * param_len, param_len, &group->order) || in ec_group_new_from_data()
467 !BN_set_word(&group->cofactor, (BN_ULONG)data->cofactor)) { in ec_group_new_from_data()
475 group->mont_data = built_in_curve_scalar_field_monts[built_in_index]; in ec_group_new_from_data()
478 group->generator = P; in ec_group_new_from_data()
484 EC_GROUP_free(group); in ec_group_new_from_data()
485 group = NULL; in ec_group_new_from_data()
494 return group; in ec_group_new_from_data()
519 void EC_GROUP_free(EC_GROUP *group) { in EC_GROUP_free() argument
520 if (!group) { in EC_GROUP_free()
524 if (group->meth->group_finish != 0) { in EC_GROUP_free()
525 group->meth->group_finish(group); in EC_GROUP_free()
528 EC_POINT_free(group->generator); in EC_GROUP_free()
529 BN_free(&group->order); in EC_GROUP_free()
530 BN_free(&group->cofactor); in EC_GROUP_free()
532 OPENSSL_free(group); in EC_GROUP_free()
575 const BN_MONT_CTX *ec_group_get_mont_data(const EC_GROUP *group) { in ec_group_get_mont_data() argument
576 return group->mont_data; in ec_group_get_mont_data()
612 const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group) { in EC_GROUP_get0_generator() argument
613 return group->generator; in EC_GROUP_get0_generator()
616 const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group) { in EC_GROUP_get0_order() argument
617 assert(!BN_is_zero(&group->order)); in EC_GROUP_get0_order()
618 return &group->order; in EC_GROUP_get0_order()
621 int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) { in EC_GROUP_get_order() argument
622 if (BN_copy(order, EC_GROUP_get0_order(group)) == NULL) { in EC_GROUP_get_order()
628 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, in EC_GROUP_get_cofactor() argument
630 if (!BN_copy(cofactor, &group->cofactor)) { in EC_GROUP_get_cofactor()
634 return !BN_is_zero(&group->cofactor); in EC_GROUP_get_cofactor()
637 int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *out_p, BIGNUM *out_a, in EC_GROUP_get_curve_GFp() argument
639 return ec_GFp_simple_group_get_curve(group, out_p, out_a, out_b, ctx); in EC_GROUP_get_curve_GFp()
642 int EC_GROUP_get_curve_name(const EC_GROUP *group) { return group->curve_name; } in EC_GROUP_get_curve_name() argument
644 unsigned EC_GROUP_get_degree(const EC_GROUP *group) { in EC_GROUP_get_degree() argument
645 return ec_GFp_simple_group_get_degree(group); in EC_GROUP_get_degree()
648 EC_POINT *EC_POINT_new(const EC_GROUP *group) { in EC_POINT_new() argument
651 if (group == NULL) { in EC_POINT_new()
662 ret->meth = group->meth; in EC_POINT_new()
704 EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group) { in EC_POINT_dup() argument
712 t = EC_POINT_new(group); in EC_POINT_dup()
726 int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point) { in EC_POINT_set_to_infinity() argument
727 if (group->meth != point->meth) { in EC_POINT_set_to_infinity()
731 return ec_GFp_simple_point_set_to_infinity(group, point); in EC_POINT_set_to_infinity()
734 int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) { in EC_POINT_is_at_infinity() argument
735 if (group->meth != point->meth) { in EC_POINT_is_at_infinity()
739 return ec_GFp_simple_is_at_infinity(group, point); in EC_POINT_is_at_infinity()
742 int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, in EC_POINT_is_on_curve() argument
744 if (group->meth != point->meth) { in EC_POINT_is_on_curve()
748 return ec_GFp_simple_is_on_curve(group, point, ctx); in EC_POINT_is_on_curve()
751 int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, in EC_POINT_cmp() argument
753 if ((group->meth != a->meth) || (a->meth != b->meth)) { in EC_POINT_cmp()
757 return ec_GFp_simple_cmp(group, a, b, ctx); in EC_POINT_cmp()
760 int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) { in EC_POINT_make_affine() argument
761 if (group->meth != point->meth) { in EC_POINT_make_affine()
765 return ec_GFp_simple_make_affine(group, point, ctx); in EC_POINT_make_affine()
768 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], in EC_POINTs_make_affine() argument
773 if (group->meth != points[i]->meth) { in EC_POINTs_make_affine()
778 return ec_GFp_simple_points_make_affine(group, num, points, ctx); in EC_POINTs_make_affine()
781 int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, in EC_POINT_get_affine_coordinates_GFp() argument
784 if (group->meth->point_get_affine_coordinates == 0) { in EC_POINT_get_affine_coordinates_GFp()
788 if (group->meth != point->meth) { in EC_POINT_get_affine_coordinates_GFp()
792 return group->meth->point_get_affine_coordinates(group, point, x, y, ctx); in EC_POINT_get_affine_coordinates_GFp()
795 int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, in EC_POINT_set_affine_coordinates_GFp() argument
798 if (group->meth != point->meth) { in EC_POINT_set_affine_coordinates_GFp()
802 if (!ec_GFp_simple_point_set_affine_coordinates(group, point, x, y, ctx)) { in EC_POINT_set_affine_coordinates_GFp()
806 if (!EC_POINT_is_on_curve(group, point, ctx)) { in EC_POINT_set_affine_coordinates_GFp()
814 int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, in EC_POINT_add() argument
816 if ((group->meth != r->meth) || (r->meth != a->meth) || in EC_POINT_add()
821 return ec_GFp_simple_add(group, r, a, b, ctx); in EC_POINT_add()
825 int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, in EC_POINT_dbl() argument
827 if ((group->meth != r->meth) || (r->meth != a->meth)) { in EC_POINT_dbl()
831 return ec_GFp_simple_dbl(group, r, a, ctx); in EC_POINT_dbl()
835 int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) { in EC_POINT_invert() argument
836 if (group->meth != a->meth) { in EC_POINT_invert()
840 return ec_GFp_simple_invert(group, a, ctx); in EC_POINT_invert()
843 int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, in EC_POINT_mul() argument
854 if (group->meth != r->meth || in EC_POINT_mul()
855 (p != NULL && group->meth != p->meth)) { in EC_POINT_mul()
860 return group->meth->mul(group, r, g_scalar, p, p_scalar, ctx); in EC_POINT_mul()
863 int ec_point_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, in ec_point_set_Jprojective_coordinates_GFp() argument
866 if (group->meth != point->meth) { in ec_point_set_Jprojective_coordinates_GFp()
870 return ec_GFp_simple_set_Jprojective_coordinates_GFp(group, point, x, y, z, in ec_point_set_Jprojective_coordinates_GFp()
874 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag) {} in EC_GROUP_set_asn1_flag() argument
876 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group) { in EC_GROUP_method_of() argument
884 void EC_GROUP_set_point_conversion_form(EC_GROUP *group, in EC_GROUP_set_point_conversion_form() argument