give EC_GROUP_new_by_nid a more meanigful name:
authorNils Larsch <nils@openssl.org>
Tue, 10 May 2005 11:37:47 +0000 (11:37 +0000)
committerNils Larsch <nils@openssl.org>
Tue, 10 May 2005 11:37:47 +0000 (11:37 +0000)
EC_GROUP_new_by_nid -> EC_GROUP_new_by_curve_name

16 files changed:
CHANGES
apps/ecparam.c
apps/s_server.c
apps/speed.c
crypto/asn1/x_pubkey.c
crypto/ec/ec.h
crypto/ec/ec_asn1.c
crypto/ec/ec_curve.c
crypto/ec/ec_err.c
crypto/ec/ectest.c
crypto/ecdh/ecdhtest.c
crypto/ecdsa/ecdsatest.c
crypto/evp/evp_pkey.c
ssl/s3_clnt.c
ssl/ssltest.c
util/libeay.num

diff --git a/CHANGES b/CHANGES
index 589d9fc..96ff52c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
   *) Include some named elliptic curves, and add OIDs from X9.62,
      SECG, and WAP/WTLS.  Each curve can be obtained from the new
      function
-          EC_GROUP_new_by_nid(),
+          EC_GROUP_new_by_curve_name(),
      and the list of available named curves can be obtained with
           EC_get_builtin_curves().
      Also add a 'curve_name' member to EC_GROUP objects, which can be
      accessed via
          EC_GROUP_set_curve_name()
          EC_GROUP_get_curve_name()
-     [Nils Larsch <nla@trustcenter.de, Bodo Moeller]
+     [Nils Larsch <larsch@trustcenter.de, Bodo Moeller]
  
   *) Remove a few calls to bn_wexpand() in BN_sqr() (the one in there
      was actually never needed) and in BN_mul().  The removal in BN_mul()
index 181cccc..b978628 100644 (file)
@@ -411,7 +411,7 @@ bad:
                        goto end;
                        }
 
-               group = EC_GROUP_new_by_nid(nid);
+               group = EC_GROUP_new_by_curve_name(nid);
                if (group == NULL)
                        {
                        BIO_printf(bio_err, "unable to create curve (%s)\n", 
index a5e8bcd..ea19a50 100644 (file)
@@ -999,7 +999,7 @@ bad:
                                goto end;
                                }
 
-                       ecdh->group = EC_GROUP_new_by_nid(nid);
+                       ecdh->group = EC_GROUP_new_by_curve_name(nid);
                        if (ecdh->group == NULL)
                                {
                                BIO_printf(bio_err, "unable to create curve (%s)\n", 
@@ -1015,7 +1015,7 @@ bad:
                else
                        {
                        BIO_printf(bio_s_out,"Using default temp ECDH parameters\n");
-                       ecdh->group=EC_GROUP_new_by_nid(NID_sect163r2);
+                       ecdh->group=EC_GROUP_new_by_curve_name(NID_sect163r2);
                        if (ecdh->group == NULL) 
                                {
                                BIO_printf(bio_err, "unable to create curve (sect163r2)\n");
index b22acd1..bd5b217 100644 (file)
@@ -2049,7 +2049,7 @@ int MAIN(int argc, char **argv)
                        } 
                else 
                        {
-                       ecdsa[j]->group = EC_GROUP_new_by_nid(test_curves[j]);
+                       ecdsa[j]->group = EC_GROUP_new_by_curve_name(test_curves[j]);
                        /* Could not obtain group information */
                        if (ecdsa[j]->group == NULL) 
                                {
@@ -2168,7 +2168,7 @@ int MAIN(int argc, char **argv)
                        }
                else
                        {
-                       ecdh_a[j]->group = EC_GROUP_new_by_nid(test_curves[j]);
+                       ecdh_a[j]->group = EC_GROUP_new_by_curve_name(test_curves[j]);
                        if (ecdh_a[j]->group == NULL)
                                {
                                BIO_printf(bio_err,"ECDH failure.\n");
index c3bfd8d..c371e4c 100644 (file)
@@ -338,7 +338,7 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
                        eckey = ret->pkey.eckey;
                        if (eckey->group)
                                EC_GROUP_free(eckey->group);
-                       if ((eckey->group = EC_GROUP_new_by_nid(
+                       if ((eckey->group = EC_GROUP_new_by_curve_name(
                              OBJ_obj2nid(a->parameter->value.object))) == NULL)
                                goto err;
                        EC_GROUP_set_asn1_flag(eckey->group, 
index 6b90e7a..cc608c7 100644 (file)
@@ -178,8 +178,9 @@ int EC_GROUP_cmp(const EC_GROUP *, const EC_GROUP *, BN_CTX *);
 EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 
-/* EC_GROUP_new_by_nid() creates a EC_GROUP structure specified by a NID */
-EC_GROUP *EC_GROUP_new_by_nid(int nid);
+/* EC_GROUP_new_by_curve_name() creates a EC_GROUP structure
+ * specified by a curve name (in form of a NID) */
+EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
 /* handling of internal curves */
 typedef struct { 
        int nid;
@@ -428,7 +429,7 @@ void ERR_load_EC_strings(void);
 #define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS               194
 #define EC_F_EC_GROUP_GROUP2NID                                 147
 #define EC_F_EC_GROUP_NEW                               108
-#define EC_F_EC_GROUP_NEW_BY_NID                        174
+#define EC_F_EC_GROUP_NEW_BY_CURVE_NAME                         174
 #define EC_F_EC_GROUP_NEW_FROM_DATA                     175
 #define EC_F_EC_GROUP_PRECOMPUTE_MULT                   142
 #define EC_F_EC_GROUP_SET_CURVE_GF2M                    176
index 6c7de81..5693201 100644 (file)
@@ -967,7 +967,7 @@ EC_GROUP *ec_asn1_pkparameters2group(const ECPKPARAMETERS *params)
        if (params->type == 0)
                { /* the curve is given by an OID */
                tmp = OBJ_obj2nid(params->value.named_curve);
-               if ((ret = EC_GROUP_new_by_nid(tmp)) == NULL)
+               if ((ret = EC_GROUP_new_by_curve_name(tmp)) == NULL)
                        {
                        ECerr(EC_F_EC_ASN1_PKPARAMETERS2GROUP, 
                              EC_R_EC_GROUP_NEW_BY_NAME_FAILURE);
index 979f865..923cb71 100644 (file)
@@ -1224,7 +1224,7 @@ err:
        return group;
        }
 
-EC_GROUP *EC_GROUP_new_by_nid(int nid)
+EC_GROUP *EC_GROUP_new_by_curve_name(int nid)
        {
        size_t i;
        EC_GROUP *ret = NULL;
@@ -1241,7 +1241,7 @@ EC_GROUP *EC_GROUP_new_by_nid(int nid)
 
        if (ret == NULL)
                {
-               ECerr(EC_F_EC_GROUP_NEW_BY_NID, EC_R_UNKNOWN_GROUP);
+               ECerr(EC_F_EC_GROUP_NEW_BY_CURVE_NAME, EC_R_UNKNOWN_GROUP);
                return NULL;
                }
 
index 4885f56..73c0055 100644 (file)
@@ -133,7 +133,7 @@ static ERR_STRING_DATA EC_str_functs[]=
 {ERR_FUNC(EC_F_EC_GROUP_GET_TRINOMIAL_BASIS),  "EC_GROUP_get_trinomial_basis"},
 {ERR_FUNC(EC_F_EC_GROUP_GROUP2NID),    "EC_GROUP_GROUP2NID"},
 {ERR_FUNC(EC_F_EC_GROUP_NEW),  "EC_GROUP_new"},
-{ERR_FUNC(EC_F_EC_GROUP_NEW_BY_NID),   "EC_GROUP_new_by_nid"},
+{ERR_FUNC(EC_F_EC_GROUP_NEW_BY_CURVE_NAME),    "EC_GROUP_new_by_curve_name"},
 {ERR_FUNC(EC_F_EC_GROUP_NEW_FROM_DATA),        "EC_GROUP_NEW_FROM_DATA"},
 {ERR_FUNC(EC_F_EC_GROUP_PRECOMPUTE_MULT),      "EC_GROUP_precompute_mult"},
 {ERR_FUNC(EC_F_EC_GROUP_SET_CURVE_GF2M),       "EC_GROUP_set_curve_GF2m"},
index 92d2f67..fdca4b4 100644 (file)
@@ -1252,10 +1252,10 @@ void internal_curve_test(void)
                {
                EC_GROUP *group = NULL;
                int nid = curves[n].nid;
-               if ((group = EC_GROUP_new_by_nid(nid)) == NULL)
+               if ((group = EC_GROUP_new_by_curve_name(nid)) == NULL)
                        {
                        ok = 0;
-                       fprintf(stdout, "\nEC_GROUP_new_by_nid() failed with"
+                       fprintf(stdout, "\nEC_GROUP_new_curve_name() failed with"
                                " curve %s\n", OBJ_nid2sn(nid));
                        /* try next curve */
                        continue;
index 2a6baf4..f4e0296 100644 (file)
@@ -132,7 +132,7 @@ int test_ecdh_curve(int nid, char *text, BN_CTX *ctx, BIO *out)
        int i,alen,blen,aout,bout,ret=0;
 
        if ((a=EC_KEY_new()) == NULL) goto err;
-       if ((a->group=EC_GROUP_new_by_nid(nid)) == NULL) goto err;
+       if ((a->group=EC_GROUP_new_by_curve_name(nid)) == NULL) goto err;
 
        if ((b=EC_KEY_new()) == NULL) goto err;
        b->group = a->group;
index 44321c5..5315d90 100644 (file)
@@ -203,7 +203,7 @@ int x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in)
        /* create the key */
        if ((key = EC_KEY_new()) == NULL)
                goto x962_int_err;
-       if ((key->group = EC_GROUP_new_by_nid(nid)) == NULL)
+       if ((key->group = EC_GROUP_new_by_curve_name(nid)) == NULL)
                goto x962_int_err;
        if (!EC_KEY_generate_key(key))
                goto x962_int_err;
@@ -337,7 +337,7 @@ int test_builtin(BIO *out)
                /* create new ecdsa key (== EC_KEY) */
                if ((eckey = EC_KEY_new()) == NULL)
                        goto builtin_err;
-               if ((eckey->group = EC_GROUP_new_by_nid(nid)) == NULL)
+               if ((eckey->group = EC_GROUP_new_by_curve_name(nid)) == NULL)
                        goto builtin_err;
                if (EC_GROUP_get_degree(eckey->group) < 160)
                        /* drop the curve */ 
@@ -356,7 +356,7 @@ int test_builtin(BIO *out)
                /* create second key */
                if ((wrong_eckey = EC_KEY_new()) == NULL)
                        goto builtin_err;
-               if ((wrong_eckey->group = EC_GROUP_new_by_nid(nid)) == NULL)
+               if ((wrong_eckey->group = EC_GROUP_new_by_curve_name(nid)) == NULL)
                        goto builtin_err;
                if (!EC_KEY_generate_key(wrong_eckey))
                        {
index 4110768..bc74bde 100644 (file)
@@ -262,7 +262,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
                                        ERR_R_MALLOC_FAILURE);
                                goto ecerr;
                        }
-                       if ((eckey->group = EC_GROUP_new_by_nid(
+                       if ((eckey->group = EC_GROUP_new_by_curve_name(
                              OBJ_obj2nid(a->parameter->value.object))) == NULL)
                                goto ecerr;
                        EC_GROUP_set_asn1_flag(eckey->group, 
index fc376cb..744748d 100644 (file)
@@ -1214,7 +1214,7 @@ int ssl3_get_key_exchange(SSL *s)
                        goto f_err;
                        }
 
-               if (!(ecdh->group=EC_GROUP_new_by_nid(curve_nid)))
+               if (!(ecdh->group=EC_GROUP_new_by_curve_name(curve_nid)))
                        {
                        SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_EC_LIB);
                        goto err;
index 9e565fb..d56f642 100644 (file)
@@ -734,7 +734,7 @@ bad:
                                        goto end;
                                        }
 
-                               ecdh->group = EC_GROUP_new_by_nid(nid);
+                               ecdh->group = EC_GROUP_new_by_curve_name(nid);
                                if (ecdh->group == NULL)
                                        {
                                        BIO_printf(bio_err, "unable to create curve (%s)\n", named_curve);
@@ -744,7 +744,7 @@ bad:
                                }
                        
                        if (ecdh->group == NULL)
-                               ecdh->group=EC_GROUP_new_by_nid(NID_sect163r2);
+                               ecdh->group=EC_GROUP_new_by_curve_name(NID_sect163r2);
 
                        SSL_CTX_set_tmp_ecdh(s_ctx, ecdh);
                        SSL_CTX_set_options(s_ctx, SSL_OP_SINGLE_ECDH_USE);
index 0fc1657..ff69cae 100755 (executable)
@@ -2906,7 +2906,7 @@ EC_POINT_set_affine_coords_GF2m         3340      EXIST:VMS:FUNCTION:EC
 BN_GF2m_mod_exp_arr                     3341   EXIST::FUNCTION:
 STORE_ATTR_INFO_modify_number           3342   EXIST::FUNCTION:
 X509_keyid_get0                         3343   EXIST::FUNCTION:
-EC_GROUP_new_by_nid                     3344   EXIST::FUNCTION:EC
+EC_GROUP_new_by_curve_name              3344   EXIST::FUNCTION:EC
 ENGINE_load_gmp                         3345   EXIST::FUNCTION:ENGINE,GMP,STATIC_ENGINE
 pitem_new                               3346   EXIST::FUNCTION:
 BN_GF2m_mod_mul_arr                     3347   EXIST::FUNCTION: