Lines Matching refs:group

384 int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,  in EC_GROUP_set_generator()  argument
386 if (group->curve_name != NID_undef || group->generator != NULL) { in EC_GROUP_set_generator()
398 group->generator = EC_POINT_new(group); in EC_GROUP_set_generator()
399 return group->generator != NULL && in EC_GROUP_set_generator()
400 EC_POINT_copy(group->generator, generator) && in EC_GROUP_set_generator()
401 BN_copy(&group->order, order); in EC_GROUP_set_generator()
406 EC_GROUP *group = NULL; in ec_group_new_from_data() local
428 group = ec_group_new(curve->method); in ec_group_new_from_data()
429 if (group == NULL || in ec_group_new_from_data()
430 !group->meth->group_set_curve(group, p, a, b, ctx)) { in ec_group_new_from_data()
435 if ((P = EC_POINT_new(group)) == NULL) { in ec_group_new_from_data()
446 if (!EC_POINT_set_affine_coordinates_GFp(group, P, x, y, ctx)) { in ec_group_new_from_data()
450 if (!BN_bin2bn(params + 5 * param_len, param_len, &group->order)) { in ec_group_new_from_data()
458 group->mont_data = built_in_curve_scalar_field_monts[built_in_index]; in ec_group_new_from_data()
461 group->generator = P; in ec_group_new_from_data()
467 EC_GROUP_free(group); in ec_group_new_from_data()
468 group = NULL; in ec_group_new_from_data()
477 return group; in ec_group_new_from_data()
502 void EC_GROUP_free(EC_GROUP *group) { in EC_GROUP_free() argument
503 if (!group) { in EC_GROUP_free()
507 if (group->meth->group_finish != 0) { in EC_GROUP_free()
508 group->meth->group_finish(group); in EC_GROUP_free()
511 EC_POINT_free(group->generator); in EC_GROUP_free()
512 BN_free(&group->order); in EC_GROUP_free()
514 OPENSSL_free(group); in EC_GROUP_free()
517 const BN_MONT_CTX *ec_group_get_mont_data(const EC_GROUP *group) { in ec_group_get_mont_data() argument
518 return group->mont_data; in ec_group_get_mont_data()
564 const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group) { in EC_GROUP_get0_generator() argument
565 return group->generator; in EC_GROUP_get0_generator()
568 const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group) { in EC_GROUP_get0_order() argument
569 assert(!BN_is_zero(&group->order)); in EC_GROUP_get0_order()
570 return &group->order; in EC_GROUP_get0_order()
573 int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) { in EC_GROUP_get_order() argument
574 if (BN_copy(order, EC_GROUP_get0_order(group)) == NULL) { in EC_GROUP_get_order()
580 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, in EC_GROUP_get_cofactor() argument
586 int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *out_p, BIGNUM *out_a, in EC_GROUP_get_curve_GFp() argument
588 return ec_GFp_simple_group_get_curve(group, out_p, out_a, out_b, ctx); in EC_GROUP_get_curve_GFp()
591 int EC_GROUP_get_curve_name(const EC_GROUP *group) { return group->curve_name; } in EC_GROUP_get_curve_name() argument
593 unsigned EC_GROUP_get_degree(const EC_GROUP *group) { in EC_GROUP_get_degree() argument
594 return ec_GFp_simple_group_get_degree(group); in EC_GROUP_get_degree()
597 EC_POINT *EC_POINT_new(const EC_GROUP *group) { in EC_POINT_new() argument
600 if (group == NULL) { in EC_POINT_new()
611 ret->meth = group->meth; in EC_POINT_new()
653 EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group) { in EC_POINT_dup() argument
658 EC_POINT *ret = EC_POINT_new(group); in EC_POINT_dup()
668 int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point) { in EC_POINT_set_to_infinity() argument
669 if (group->meth != point->meth) { in EC_POINT_set_to_infinity()
673 return ec_GFp_simple_point_set_to_infinity(group, point); in EC_POINT_set_to_infinity()
676 int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) { in EC_POINT_is_at_infinity() argument
677 if (group->meth != point->meth) { in EC_POINT_is_at_infinity()
681 return ec_GFp_simple_is_at_infinity(group, point); in EC_POINT_is_at_infinity()
684 int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, in EC_POINT_is_on_curve() argument
686 if (group->meth != point->meth) { in EC_POINT_is_on_curve()
690 return ec_GFp_simple_is_on_curve(group, point, ctx); in EC_POINT_is_on_curve()
693 int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, in EC_POINT_cmp() argument
695 if ((group->meth != a->meth) || (a->meth != b->meth)) { in EC_POINT_cmp()
699 return ec_GFp_simple_cmp(group, a, b, ctx); in EC_POINT_cmp()
702 int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) { in EC_POINT_make_affine() argument
703 if (group->meth != point->meth) { in EC_POINT_make_affine()
707 return ec_GFp_simple_make_affine(group, point, ctx); in EC_POINT_make_affine()
710 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], in EC_POINTs_make_affine() argument
713 if (group->meth != points[i]->meth) { in EC_POINTs_make_affine()
718 return ec_GFp_simple_points_make_affine(group, num, points, ctx); in EC_POINTs_make_affine()
721 int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, in EC_POINT_get_affine_coordinates_GFp() argument
724 if (group->meth->point_get_affine_coordinates == 0) { in EC_POINT_get_affine_coordinates_GFp()
728 if (group->meth != point->meth) { in EC_POINT_get_affine_coordinates_GFp()
732 return group->meth->point_get_affine_coordinates(group, point, x, y, ctx); in EC_POINT_get_affine_coordinates_GFp()
735 int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, in EC_POINT_set_affine_coordinates_GFp() argument
738 if (group->meth != point->meth) { in EC_POINT_set_affine_coordinates_GFp()
742 if (!ec_GFp_simple_point_set_affine_coordinates(group, point, x, y, ctx)) { in EC_POINT_set_affine_coordinates_GFp()
746 if (!EC_POINT_is_on_curve(group, point, ctx)) { in EC_POINT_set_affine_coordinates_GFp()
754 int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, in EC_POINT_add() argument
756 if ((group->meth != r->meth) || (r->meth != a->meth) || in EC_POINT_add()
761 return ec_GFp_simple_add(group, r, a, b, ctx); in EC_POINT_add()
765 int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, in EC_POINT_dbl() argument
767 if ((group->meth != r->meth) || (r->meth != a->meth)) { in EC_POINT_dbl()
771 return ec_GFp_simple_dbl(group, r, a, ctx); in EC_POINT_dbl()
775 int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) { in EC_POINT_invert() argument
776 if (group->meth != a->meth) { in EC_POINT_invert()
780 return ec_GFp_simple_invert(group, a, ctx); in EC_POINT_invert()
783 int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, in EC_POINT_mul() argument
794 if (group->meth != r->meth || in EC_POINT_mul()
795 (p != NULL && group->meth != p->meth)) { in EC_POINT_mul()
800 return group->meth->mul(group, r, g_scalar, p, p_scalar, ctx); in EC_POINT_mul()
803 int ec_point_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, in ec_point_set_Jprojective_coordinates_GFp() argument
806 if (group->meth != point->meth) { in ec_point_set_Jprojective_coordinates_GFp()
810 return ec_GFp_simple_set_Jprojective_coordinates_GFp(group, point, x, y, z, in ec_point_set_Jprojective_coordinates_GFp()
814 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag) {} in EC_GROUP_set_asn1_flag() argument
816 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group) { in EC_GROUP_method_of() argument
824 void EC_GROUP_set_point_conversion_form(EC_GROUP *group, in EC_GROUP_set_point_conversion_form() argument