aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_lib.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2002-06-12 14:01:17 +0000
committerBodo Möller <bodo@openssl.org>2002-06-12 14:01:17 +0000
commit254ef80db19a6f6610ef07535efd699cef7aa855 (patch)
treea2beefac629bbe499299ef89cce8411f5ebd2908 /crypto/ec/ec_lib.c
parentf9de8446a0a623936925d12812480fe86f5a9f71 (diff)
downloadopenssl-254ef80db19a6f6610ef07535efd699cef7aa855.tar.gz
simplify asn1_flag
Submitted by: Nils Larsch Reviewed by: Bodo Moeller
Diffstat (limited to 'crypto/ec/ec_lib.c')
-rw-r--r--crypto/ec/ec_lib.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c
index 06d45e998f..965c229dea 100644
--- a/crypto/ec/ec_lib.c
+++ b/crypto/ec/ec_lib.c
@@ -98,8 +98,9 @@ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
BN_init(&ret->order);
BN_init(&ret->cofactor);
- ret->nid = 0;
- ret->asn1_flag = OPENSSL_EC_EXPLICIT | OPENSSL_EC_COMPRESSED;
+ ret->curve_name = 0;
+ ret->asn1_flag = 0;
+ ret->asn1_form = POINT_CONVERSION_COMPRESSED;
ret->seed = NULL;
ret->seed_len = 0;
@@ -214,8 +215,9 @@ int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
if (!BN_copy(&dest->order, &src->order)) return 0;
if (!BN_copy(&dest->cofactor, &src->cofactor)) return 0;
- dest->nid = src->nid;
- dest->asn1_flag = src->asn1_flag;
+ dest->curve_name = src->curve_name;
+ dest->asn1_flag = src->asn1_flag;
+ dest->asn1_form = src->asn1_form;
if (src->seed)
{
@@ -308,13 +310,13 @@ int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
void EC_GROUP_set_nid(EC_GROUP *group, int nid)
{
- group->nid = nid;
+ group->curve_name = nid;
}
int EC_GROUP_get_nid(const EC_GROUP *group)
{
- return group->nid;
+ return group->curve_name;
}
@@ -330,6 +332,19 @@ int EC_GROUP_get_asn1_flag(const EC_GROUP *group)
}
+void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
+ point_conversion_form_t form)
+ {
+ group->asn1_form = form;
+ }
+
+
+point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *group)
+ {
+ return group->asn1_form;
+ }
+
+
int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
{
if (group->meth->group_set_curve_GFp == 0)