Lines Matching defs:group

67 int EC_GROUP_get_basis_type(const EC_GROUP *group)
71 if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
76 /* Find the last non-zero element of group->poly[] */
78 i < (int)OSSL_NELEM(group->poly) && group->poly[i] != 0;
92 int EC_GROUP_get_trinomial_basis(const EC_GROUP *group, unsigned int *k)
94 if (group == NULL)
97 if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
99 || !((group->poly[0] != 0) && (group->poly[1] != 0)
100 && (group->poly[2] == 0))) {
107 *k = group->poly[1];
112 int EC_GROUP_get_pentanomial_basis(const EC_GROUP *group, unsigned int *k1,
115 if (group == NULL)
118 if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
120 || !((group->poly[0] != 0) && (group->poly[1] != 0)
121 && (group->poly[2] != 0) && (group->poly[3] != 0)
122 && (group->poly[4] == 0))) {
129 *k1 = group->poly[3];
131 *k2 = group->poly[2];
133 *k3 = group->poly[1];
316 static int ec_asn1_group2fieldid(const EC_GROUP *group, X9_62_FIELDID *field)
321 if (group == NULL || field == NULL)
330 nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
343 if (!EC_GROUP_get_curve_GFp(group, tmp, NULL, NULL, NULL)) {
372 char_two->m = (long)EC_GROUP_get_degree(group);
374 field_type = EC_GROUP_get_basis_type(group);
389 if (!EC_GROUP_get_trinomial_basis(group, &k))
404 if (!EC_GROUP_get_pentanomial_basis(group, &k1, &k2, &k3))
436 static int ec_asn1_group2curve(const EC_GROUP *group, X9_62_CURVE *curve)
445 if (!group || !curve || !curve->a || !curve->b)
453 nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
457 if (!EC_GROUP_get_curve_GFp(group, NULL, tmp_1, tmp_2, NULL)) {
465 if (!EC_GROUP_get_curve_GF2m(group, NULL, tmp_1, tmp_2, NULL)) {
514 if (group->seed) {
522 if (!ASN1_BIT_STRING_set(curve->seed, group->seed,
523 (int)group->seed_len)) {
547 static ECPARAMETERS *ec_asn1_group2parameters(const EC_GROUP *group,
575 if (!ec_asn1_group2fieldid(group, ret->fieldID)) {
581 if (!ec_asn1_group2curve(group, ret->curve)) {
587 if ((point = EC_GROUP_get0_generator(group)) == NULL) {
592 form = EC_GROUP_get_point_conversion_form(group);
594 len = EC_POINT_point2oct(group, point, form, NULL, len, NULL);
603 if (!EC_POINT_point2oct(group, point, form, buffer, len, NULL)) {
617 if (!EC_GROUP_get_order(group, tmp, NULL)) {
628 if (EC_GROUP_get_cofactor(group, tmp, NULL)) {
650 ECPKPARAMETERS *ec_asn1_group2pkparameters(const EC_GROUP *group,
668 if (EC_GROUP_get_asn1_flag(group)) {
672 tmp = EC_GROUP_get_curve_name(group);
684 ec_asn1_group2parameters(group, NULL)) == NULL)
920 * Check if the explicit parameters group just created matches one of the
923 * We create a copy of the group just built, so that we can remove optional
948 * parameters with one created from a named group.
979 * sure it is not added to the returned group.
1056 EC_GROUP *group = NULL;
1066 if ((group = ec_asn1_pkparameters2group(params)) == NULL) {
1075 *a = group;
1079 return (group);
1122 if (ret->group)
1123 EC_GROUP_free(ret->group);
1124 ret->group = ec_asn1_pkparameters2group(priv_key->parameters);
1127 if (ret->group == NULL) {
1149 ret->pub_key = EC_POINT_new(ret->group);
1170 if (!EC_POINT_oct2point(ret->group, ret->pub_key,
1177 (ret->group, ret->pub_key, ret->priv_key, NULL, NULL, NULL)) {
1209 if (a == NULL || a->group == NULL || a->priv_key == NULL ||
1226 buf_len = (EC_GROUP_get_degree(a->group) + 7) / 8;
1255 ec_asn1_group2pkparameters(a->group,
1269 tmp_len = EC_POINT_point2oct(a->group, a->pub_key,
1282 if (!EC_POINT_point2oct(a->group, a->pub_key,
1315 return i2d_ECPKParameters(a->group, out);
1335 if (!d2i_ECPKParameters(&ret->group, in, len)) {
1352 if (a == NULL || (*a) == NULL || (*a)->group == NULL) {
1361 (ret->pub_key = EC_POINT_new(ret->group)) == NULL) {
1365 if (!EC_POINT_oct2point(ret->group, ret->pub_key, *in, len, NULL)) {
1385 buf_len = EC_POINT_point2oct(a->group, a->pub_key,
1399 if (!EC_POINT_point2oct(a->group, a->pub_key, a->conv_form,