move EC_GROUP_get_basis_type() from ec_lib.c to ec_asn1.c

This commit is contained in:
Bodo Möller
2002-08-26 11:33:13 +00:00
parent 7e31164ae0
commit 8aefe253a7
4 changed files with 54 additions and 45 deletions

View File

@@ -537,45 +537,6 @@ void EC_GROUP_clear_free_extra_data(EC_GROUP *group)
}
int EC_GROUP_get_basis_type(const EC_GROUP *group, unsigned int *k1,
unsigned int *k2, unsigned int *k3)
{
int i = 0;
if (group == NULL)
return 0;
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
NID_X9_62_characteristic_two_field)
/* everything else is currently not supported */
return 0;
while (group->poly[i] != 0)
i++;
if (i == 4)
{
if (k1)
*k1 = group->poly[3];
if (k2)
*k2 = group->poly[2];
if (k3)
*k3 = group->poly[1];
return NID_X9_62_ppBasis;
}
else if (i == 2)
{
if (k1)
*k1 = group->poly[1];
return NID_X9_62_tpBasis;
}
else
/* everything else is currently not supported */
return 0;
}
/* functions for EC_POINT objects */
EC_POINT *EC_POINT_new(const EC_GROUP *group)