]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Move EC_METHOD to internal-only
authorBilly Brumley <bbrumley@gmail.com>
Wed, 27 May 2020 10:30:04 +0000 (13:30 +0300)
committerNicola Tuveri <nic.tuv@gmail.com>
Tue, 2 Jun 2020 08:17:24 +0000 (11:17 +0300)
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11928)

18 files changed:
CHANGES.md
apps/ecparam.c
crypto/ec/ec_asn1.c
crypto/ec/ec_curve.c
crypto/ec/ec_cvt.c
crypto/ec/ec_key.c
crypto/ec/ec_lib.c
crypto/ec/ec_local.h
crypto/ec/eck_prn.c
crypto/ec/ecp_s390x_nistp.c
doc/man3/EC_GFp_simple_method.pod
doc/man3/EC_GROUP_copy.pod
doc/man3/EC_GROUP_new.pod
doc/man3/EC_POINT_new.pod
include/openssl/ec.h
ssl/t1_lib.c
test/ectest.c
util/libcrypto.num

index 241d6ca23c4ec695f108689ad365a89b6c32a75a..68fa1e00330de54b1a3713c07fca24a86825eb31 100644 (file)
@@ -23,6 +23,26 @@ OpenSSL 3.0
 
 ### Changes between 1.1.1 and 3.0 [xx XXX xxxx]
 
 
 ### Changes between 1.1.1 and 3.0 [xx XXX xxxx]
 
+ * Deprecated EC_METHOD_get_field_type(). Applications should switch to
+   EC_GROUP_get_field_type().
+
+   *Billy Bob Brumley*
+
+ * Deprecated EC_GFp_simple_method(), EC_GFp_mont_method(),
+   EC_GF2m_simple_method(), EC_GFp_nist_method(), EC_GFp_nistp224_method()
+   EC_GFp_nistp256_method(), and EC_GFp_nistp521_method().
+   Applications should rely on the library automatically assigning a suitable
+   EC_METHOD internally upon EC_GROUP construction.
+
+   *Billy Bob Brumley*
+
+ * Deprecated EC_GROUP_new(), EC_GROUP_method_of(), and EC_POINT_method_of().
+   EC_METHOD is now an internal-only concept and a suitable EC_METHOD is
+   assigned internally without application intervention.
+   Users of EC_GROUP_new() should switch to a different suitable constructor.
+
+   *Billy Bob Brumley*
+
  * Add CAdES-BES signature verification support, mostly derived
    from ESSCertIDv2 TS (RFC 5816) contribution by Marek Klein.
 
  * Add CAdES-BES signature verification support, mostly derived
    from ESSCertIDv2 TS (RFC 5816) contribution by Marek Klein.
 
index 635bde2db242bc68cf095919b3a9454ab925d78f..4abb0517d96990babace8198f8e6f405f30d5297 100644 (file)
@@ -305,7 +305,6 @@ int ecparam_main(int argc, char **argv)
         size_t buf_len = 0, tmp_len = 0;
         const EC_POINT *point;
         int is_prime, len = 0;
         size_t buf_len = 0, tmp_len = 0;
         const EC_POINT *point;
         int is_prime, len = 0;
-        const EC_METHOD *meth = EC_GROUP_method_of(group);
 
         if ((ec_p = BN_new()) == NULL
                 || (ec_a = BN_new()) == NULL
 
         if ((ec_p = BN_new()) == NULL
                 || (ec_a = BN_new()) == NULL
@@ -317,7 +316,7 @@ int ecparam_main(int argc, char **argv)
             goto end;
         }
 
             goto end;
         }
 
-        is_prime = (EC_METHOD_get_field_type(meth) == NID_X9_62_prime_field);
+        is_prime = (EC_GROUP_get_field_type(group) == NID_X9_62_prime_field);
         if (!is_prime) {
             BIO_printf(bio_err, "Can only handle X9.62 prime fields\n");
             goto end;
         if (!is_prime) {
             BIO_printf(bio_err, "Can only handle X9.62 prime fields\n");
             goto end;
index b2c91efbfdd4735f3a3d7a4150ec7f6d93be1613..a53573cc92287cd2c811dcf4aaa4db506789452f 100644 (file)
@@ -27,8 +27,7 @@ int EC_GROUP_get_basis_type(const EC_GROUP *group)
 {
     int i;
 
 {
     int i;
 
-    if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
-        NID_X9_62_characteristic_two_field)
+    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field)
         /* everything else is currently not supported */
         return 0;
 
         /* everything else is currently not supported */
         return 0;
 
@@ -53,8 +52,7 @@ int EC_GROUP_get_trinomial_basis(const EC_GROUP *group, unsigned int *k)
     if (group == NULL)
         return 0;
 
     if (group == NULL)
         return 0;
 
-    if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
-        NID_X9_62_characteristic_two_field
+    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
         || !((group->poly[0] != 0) && (group->poly[1] != 0)
              && (group->poly[2] == 0))) {
         ECerr(EC_F_EC_GROUP_GET_TRINOMIAL_BASIS,
         || !((group->poly[0] != 0) && (group->poly[1] != 0)
              && (group->poly[2] == 0))) {
         ECerr(EC_F_EC_GROUP_GET_TRINOMIAL_BASIS,
@@ -74,8 +72,7 @@ int EC_GROUP_get_pentanomial_basis(const EC_GROUP *group, unsigned int *k1,
     if (group == NULL)
         return 0;
 
     if (group == NULL)
         return 0;
 
-    if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
-        NID_X9_62_characteristic_two_field
+    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
         || !((group->poly[0] != 0) && (group->poly[1] != 0)
              && (group->poly[2] != 0) && (group->poly[3] != 0)
              && (group->poly[4] == 0))) {
         || !((group->poly[0] != 0) && (group->poly[1] != 0)
              && (group->poly[2] != 0) && (group->poly[3] != 0)
              && (group->poly[4] == 0))) {
@@ -262,7 +259,7 @@ static int ec_asn1_group2fieldid(const EC_GROUP *group, X9_62_FIELDID *field)
     ASN1_OBJECT_free(field->fieldType);
     ASN1_TYPE_free(field->p.other);
 
     ASN1_OBJECT_free(field->fieldType);
     ASN1_TYPE_free(field->p.other);
 
-    nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
+    nid = EC_GROUP_get_field_type(group);
     /* set OID for the field */
     if ((field->fieldType = OBJ_nid2obj(nid)) == NULL) {
         ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_OBJ_LIB);
     /* set OID for the field */
     if ((field->fieldType = OBJ_nid2obj(nid)) == NULL) {
         ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_OBJ_LIB);
index 9f929883ec40bfd9866a09264ecc2c862649e382..3be62b3655240830f36d7c60ad71a1b802f68896 100644 (file)
@@ -3195,7 +3195,7 @@ static EC_GROUP *ec_group_new_from_data(OPENSSL_CTX *libctx,
 
     /* If no curve data curve method must handle everything */
     if (curve.data == NULL)
 
     /* If no curve data curve method must handle everything */
     if (curve.data == NULL)
-        return EC_GROUP_new_ex(libctx,
+        return ec_group_new_ex(libctx,
                                curve.meth != NULL ? curve.meth() : NULL);
 
     if ((ctx = BN_CTX_new_ex(libctx)) == NULL) {
                                curve.meth != NULL ? curve.meth() : NULL);
 
     if ((ctx = BN_CTX_new_ex(libctx)) == NULL) {
@@ -3218,7 +3218,7 @@ static EC_GROUP *ec_group_new_from_data(OPENSSL_CTX *libctx,
 
     if (curve.meth != 0) {
         meth = curve.meth();
 
     if (curve.meth != 0) {
         meth = curve.meth();
-        if (((group = EC_GROUP_new_ex(libctx, meth)) == NULL) ||
+        if (((group = ec_group_new_ex(libctx, meth)) == NULL) ||
             (!(group->meth->group_set_curve(group, p, a, b, ctx)))) {
             ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
             goto err;
             (!(group->meth->group_set_curve(group, p, a, b, ctx)))) {
             ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
             goto err;
@@ -3388,17 +3388,13 @@ int ec_curve_nid_from_params(const EC_GROUP *group, BN_CTX *ctx)
     unsigned char *param_bytes = NULL;
     const EC_CURVE_DATA *data;
     const EC_POINT *generator = NULL;
     unsigned char *param_bytes = NULL;
     const EC_CURVE_DATA *data;
     const EC_POINT *generator = NULL;
-    const EC_METHOD *meth;
     const BIGNUM *cofactor = NULL;
     /* An array of BIGNUMs for (p, a, b, x, y, order) */
     BIGNUM *bn[NUM_BN_FIELDS] = {NULL, NULL, NULL, NULL, NULL, NULL};
 
     const BIGNUM *cofactor = NULL;
     /* An array of BIGNUMs for (p, a, b, x, y, order) */
     BIGNUM *bn[NUM_BN_FIELDS] = {NULL, NULL, NULL, NULL, NULL, NULL};
 
-    meth = EC_GROUP_method_of(group);
-    if (meth == NULL)
-        return -1;
     /* Use the optional named curve nid as a search field */
     nid = EC_GROUP_get_curve_name(group);
     /* Use the optional named curve nid as a search field */
     nid = EC_GROUP_get_curve_name(group);
-    field_type = EC_METHOD_get_field_type(meth);
+    field_type = EC_GROUP_get_field_type(group);
     seed_len = EC_GROUP_get_seed_len(group);
     seed = EC_GROUP_get0_seed(group);
     cofactor = EC_GROUP_get0_cofactor(group);
     seed_len = EC_GROUP_get_seed_len(group);
     seed = EC_GROUP_get0_seed(group);
     cofactor = EC_GROUP_get0_cofactor(group);
index 6d58fdbe10017ebf8a1de8245f1cb0f1c9c4a2a0..a8ea6fe7fd65d83d3009dd66338ee28a29632182 100644 (file)
@@ -54,7 +54,7 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
         meth = EC_GFp_mont_method();
 #endif
 
         meth = EC_GFp_mont_method();
 #endif
 
-    ret = EC_GROUP_new_ex(bn_get_lib_ctx(ctx), meth);
+    ret = ec_group_new_ex(bn_get_lib_ctx(ctx), meth);
     if (ret == NULL)
         return NULL;
 
     if (ret == NULL)
         return NULL;
 
@@ -75,7 +75,7 @@ EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
 
     meth = EC_GF2m_simple_method();
 
 
     meth = EC_GF2m_simple_method();
 
-    ret = EC_GROUP_new_ex(bn_get_lib_ctx(ctx), meth);
+    ret = ec_group_new_ex(bn_get_lib_ctx(ctx), meth);
     if (ret == NULL)
         return NULL;
 
     if (ret == NULL)
         return NULL;
 
index aae31719076a6076adefed6a40367230a7d2d41c..47feede54bc26ae8b9c1a9d120f803d1cf8344b7 100644 (file)
@@ -117,10 +117,9 @@ EC_KEY *EC_KEY_copy(EC_KEY *dest, const EC_KEY *src)
     dest->libctx = src->libctx;
     /* copy the parameters */
     if (src->group != NULL) {
     dest->libctx = src->libctx;
     /* copy the parameters */
     if (src->group != NULL) {
-        const EC_METHOD *meth = EC_GROUP_method_of(src->group);
         /* clear the old group */
         EC_GROUP_free(dest->group);
         /* clear the old group */
         EC_GROUP_free(dest->group);
-        dest->group = EC_GROUP_new_ex(src->libctx, meth);
+        dest->group = ec_group_new_ex(src->libctx, src->group->meth);
         if (dest->group == NULL)
             return NULL;
         if (!EC_GROUP_copy(dest->group, src->group))
         if (dest->group == NULL)
             return NULL;
         if (!EC_GROUP_copy(dest->group, src->group))
@@ -398,7 +397,7 @@ static int ec_key_public_range_check(BN_CTX *ctx, const EC_KEY *key)
     if (!EC_POINT_get_affine_coordinates(key->group, key->pub_key, x, y, ctx))
         goto err;
 
     if (!EC_POINT_get_affine_coordinates(key->group, key->pub_key, x, y, ctx))
         goto err;
 
-    if (EC_METHOD_get_field_type(key->group->meth) == NID_X9_62_prime_field) {
+    if (EC_GROUP_get_field_type(key->group) == NID_X9_62_prime_field) {
         if (BN_is_negative(x)
             || BN_cmp(x, key->group->field) >= 0
             || BN_is_negative(y)
         if (BN_is_negative(x)
             || BN_cmp(x, key->group->field) >= 0
             || BN_is_negative(y)
index 1b2ddc2b4437632a49caec8ebb3ce365d751e801..f62eff5034f6a99dac8808c8bebef39e77c73364 100644 (file)
@@ -23,7 +23,7 @@
 
 /* functions for EC_GROUP objects */
 
 
 /* functions for EC_GROUP objects */
 
-EC_GROUP *EC_GROUP_new_ex(OPENSSL_CTX *libctx, const EC_METHOD *meth)
+EC_GROUP *ec_group_new_ex(OPENSSL_CTX *libctx, const EC_METHOD *meth)
 {
     EC_GROUP *ret;
 
 {
     EC_GROUP *ret;
 
@@ -65,11 +65,13 @@ EC_GROUP *EC_GROUP_new_ex(OPENSSL_CTX *libctx, const EC_METHOD *meth)
     return NULL;
 }
 
     return NULL;
 }
 
-#ifndef FIPS_MODULE
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+# ifndef FIPS_MODULE
 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
 {
 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
 {
-    return EC_GROUP_new_ex(NULL, meth);
+    return ec_group_new_ex(NULL, meth);
 }
 }
+# endif
 #endif
 
 void EC_pre_comp_free(EC_GROUP *group)
 #endif
 
 void EC_pre_comp_free(EC_GROUP *group)
@@ -255,7 +257,7 @@ EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)
     if (a == NULL)
         return NULL;
 
     if (a == NULL)
         return NULL;
 
-    if ((t = EC_GROUP_new_ex(a->libctx, a->meth)) == NULL)
+    if ((t = ec_group_new_ex(a->libctx, a->meth)) == NULL)
         return NULL;
     if (!EC_GROUP_copy(t, a))
         goto err;
         return NULL;
     if (!EC_GROUP_copy(t, a))
         goto err;
@@ -270,6 +272,7 @@ EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)
         return t;
 }
 
         return t;
 }
 
+#ifndef OPENSSL_NO_DEPRECATED_3_0
 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group)
 {
     return group->meth;
 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group)
 {
     return group->meth;
@@ -279,6 +282,7 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
 {
     return meth->field_type;
 }
 {
     return meth->field_type;
 }
+#endif
 
 static int ec_precompute_mont_data(EC_GROUP *);
 
 
 static int ec_precompute_mont_data(EC_GROUP *);
 
@@ -475,6 +479,11 @@ const BIGNUM *EC_GROUP_get0_field(const EC_GROUP *group)
     return group->field;
 }
 
     return group->field;
 }
 
+int EC_GROUP_get_field_type(const EC_GROUP *group)
+{
+    return group->meth->field_type;
+}
+
 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag)
 {
     group->asn1_flag = flag;
 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag)
 {
     group->asn1_flag = flag;
@@ -602,8 +611,7 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx)
 #endif
 
     /* compare the field types */
 #endif
 
     /* compare the field types */
-    if (EC_METHOD_get_field_type(EC_GROUP_method_of(a)) !=
-        EC_METHOD_get_field_type(EC_GROUP_method_of(b)))
+    if (EC_GROUP_get_field_type(a) != EC_GROUP_get_field_type(b))
         return 1;
     /* compare the curve name (if present in both) */
     if (EC_GROUP_get_curve_name(a) && EC_GROUP_get_curve_name(b) &&
         return 1;
     /* compare the curve name (if present in both) */
     if (EC_GROUP_get_curve_name(a) && EC_GROUP_get_curve_name(b) &&
@@ -777,10 +785,12 @@ EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group)
     return t;
 }
 
     return t;
 }
 
+#ifndef OPENSSL_NO_DEPRECATED_3_0
 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point)
 {
     return point->meth;
 }
 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point)
 {
     return point->meth;
 }
+#endif
 
 int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point)
 {
 
 int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point)
 {
index d9383f10a7a6553b2f330e6da6fe0705e26a2bc3..7f9b61bc492e2001130e851a669386416e69e11e 100644 (file)
 /* Curve does not support signing operations */
 #define EC_FLAGS_NO_SIGN        0x4
 
 /* Curve does not support signing operations */
 #define EC_FLAGS_NO_SIGN        0x4
 
+#ifdef OPENSSL_NO_DEPRECATED_3_0
+typedef struct ec_method_st EC_METHOD;
+#endif
+
 /*
  * Structure details are not part of the exported interface, so all this may
  * change in future versions.
 /*
  * Structure details are not part of the exported interface, so all this may
  * change in future versions.
@@ -585,6 +589,15 @@ void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign,
 #endif
 int ec_group_simple_order_bits(const EC_GROUP *group);
 
 #endif
 int ec_group_simple_order_bits(const EC_GROUP *group);
 
+/**
+ *  Creates a new EC_GROUP object
+ *  \param   libctx The associated library context or NULL for the default
+ *                  library context
+ *  \param   meth   EC_METHOD to use
+ *  \return  newly created EC_GROUP object or NULL in case of an error.
+ */
+EC_GROUP *ec_group_new_ex(OPENSSL_CTX *libctx, const EC_METHOD *meth);
+
 #ifdef ECP_NISTZ256_ASM
 /** Returns GFp methods using montgomery multiplication, with x86-64 optimized
  * P256. See http://eprint.iacr.org/2013/816.
 #ifdef ECP_NISTZ256_ASM
 /** Returns GFp methods using montgomery multiplication, with x86-64 optimized
  * P256. See http://eprint.iacr.org/2013/816.
index 51ebedd731c345eead5078bd347a651a3a5ae9eb..6bcfe032d422cd348a574ddb55ba998e48b3d3d5 100644 (file)
@@ -115,7 +115,7 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
         /* explicit parameters */
         int is_char_two = 0;
         point_conversion_form_t form;
         /* explicit parameters */
         int is_char_two = 0;
         point_conversion_form_t form;
-        int tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(x));
+        int tmp_nid = EC_GROUP_get_field_type(x);
 
         if (tmp_nid == NID_X9_62_characteristic_two_field)
             is_char_two = 1;
 
         if (tmp_nid == NID_X9_62_characteristic_two_field)
             is_char_two = 1;
index 75c8475e69789434ff97051d5fe936e788f4a59c..edbad15cdd096164963a1d48099f2294d0d2b51e 100644 (file)
@@ -7,6 +7,12 @@
  * https://www.openssl.org/source/license.html
  */
 
  * https://www.openssl.org/source/license.html
  */
 
+/*
+ * EC_METHOD low level APIs are deprecated for public use, but still ok for
+ * internal use.
+ */
+#include "internal/deprecated.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/err.h>
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/err.h>
index 4d8f1fbaf019ced71886d00948818527885d9cdd..cbdb6ec1c3c2d900a5e7d034b5b50c82744b1867 100644 (file)
@@ -8,6 +8,8 @@ EC_GFp_simple_method, EC_GFp_mont_method, EC_GFp_nist_method, EC_GFp_nistp224_me
 
  #include <openssl/ec.h>
 
 
  #include <openssl/ec.h>
 
+Deprecated since OpenSSL 3.0:
+
  const EC_METHOD *EC_GFp_simple_method(void);
  const EC_METHOD *EC_GFp_mont_method(void);
  const EC_METHOD *EC_GFp_nist_method(void);
  const EC_METHOD *EC_GFp_simple_method(void);
  const EC_METHOD *EC_GFp_mont_method(void);
  const EC_METHOD *EC_GFp_nist_method(void);
@@ -21,6 +23,10 @@ EC_GFp_simple_method, EC_GFp_mont_method, EC_GFp_nist_method, EC_GFp_nistp224_me
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
+
+All const EC_METHOD *EC_GF* functions were deprecated in OpenSSL 3.0, since
+EC_METHOD is no longer a public concept.
+
 The Elliptic Curve library provides a number of different implementations through a single common interface.
 When constructing a curve using EC_GROUP_new (see L<EC_GROUP_new(3)>) an
 implementation method must be provided. The functions described here all return a const pointer to an
 The Elliptic Curve library provides a number of different implementations through a single common interface.
 When constructing a curve using EC_GROUP_new (see L<EC_GROUP_new(3)>) an
 implementation method must be provided. The functions described here all return a const pointer to an
@@ -39,10 +45,8 @@ The functions EC_GFp_nistp224_method, EC_GFp_nistp256_method and EC_GFp_nistp521
 optimised implementations for the NIST P224, P256 and P521 curves respectively. Note, however, that these
 implementations are not available on all platforms.
 
 optimised implementations for the NIST P224, P256 and P521 curves respectively. Note, however, that these
 implementations are not available on all platforms.
 
-EC_METHOD_get_field_type identifies what type of field the EC_METHOD structure supports, which will be either
-F2^m or Fp. If the field type is Fp then the value B<NID_X9_62_prime_field> is returned. If the field type is
-F2^m then the value B<NID_X9_62_characteristic_two_field> is returned. These values are defined in the
-obj_mac.h header file.
+EC_METHOD_get_field_type() was deprecated in OpenSSL 3.0.
+Applications should use EC_GROUP_get_field_type() as a replacement (see L<EC_GROUP_copy(3)>).
 
 =head1 RETURN VALUES
 
 
 =head1 RETURN VALUES
 
@@ -57,6 +61,14 @@ L<EC_POINT_new(3)>, L<EC_POINT_add(3)>, L<EC_KEY_new(3)>,
 L<d2i_ECPKParameters(3)>,
 L<BN_mod_mul_montgomery(3)>
 
 L<d2i_ECPKParameters(3)>,
 L<BN_mod_mul_montgomery(3)>
 
+=head1 HISTORY
+
+EC_GFp_simple_method(), EC_GFp_mont_method(void),
+EC_GFp_nist_method(), EC_GFp_nistp224_method(),
+EC_GFp_nistp256_method(), EC_GFp_nistp521_method(),
+EC_GF2m_simple_method(), and EC_METHOD_get_field_type()
+were deprecated in OpenSSL 3.0.
+
 =head1 COPYRIGHT
 
 Copyright 2013-2017 The OpenSSL Project Authors. All Rights Reserved.
 =head1 COPYRIGHT
 
 Copyright 2013-2017 The OpenSSL Project Authors. All Rights Reserved.
index e9a1d183ca41043a9ca65e732cf198fcf9657067..6f3348185650b92af9e6eb05c2f2d834950cd47d 100644 (file)
@@ -22,8 +22,6 @@ EC_GROUP_get_pentanomial_basis, EC_GROUP_get0_field
  int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
  EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
 
  int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
  EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
 
- const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
-
  int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
                             const BIGNUM *order, const BIGNUM *cofactor);
  const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
  int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
                             const BIGNUM *order, const BIGNUM *cofactor);
  const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
@@ -63,6 +61,10 @@ EC_GROUP_get_pentanomial_basis, EC_GROUP_get0_field
  int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
                                     unsigned int *k2, unsigned int *k3);
 
  int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
                                     unsigned int *k2, unsigned int *k3);
 
+Deprecated since OpenSSL 3.0:
+
+ const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
+
 =head1 DESCRIPTION
 
 EC_GROUP_copy() copies the curve B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
 =head1 DESCRIPTION
 
 EC_GROUP_copy() copies the curve B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
@@ -71,6 +73,7 @@ EC_GROUP_dup() creates a new EC_GROUP object and copies the content from B<src>
 EC_GROUP object.
 
 EC_GROUP_method_of() obtains the EC_METHOD of B<group>.
 EC_GROUP object.
 
 EC_GROUP_method_of() obtains the EC_METHOD of B<group>.
+This function was deprecated in OpenSSL 3.0, since EC_METHOD is no longer a public concept.
 
 EC_GROUP_set_generator() sets curve parameters that must be agreed by all participants using the curve. These
 parameters include the B<generator>, the B<order> and the B<cofactor>. The B<generator> is a well defined point on the
 
 EC_GROUP_set_generator() sets curve parameters that must be agreed by all participants using the curve. These
 parameters include the B<generator>, the B<order> and the B<cofactor>. The B<generator> is a well defined point on the
@@ -140,8 +143,12 @@ built-in curves within the library provide seed values that can be obtained. It
 EC_GROUP_set_seed() and passing a pointer to a memory block, along with the length of the seed. Again, the EC library will not use
 this seed value, although it will be preserved in any ASN1 based communications.
 
 EC_GROUP_set_seed() and passing a pointer to a memory block, along with the length of the seed. Again, the EC library will not use
 this seed value, although it will be preserved in any ASN1 based communications.
 
-EC_GROUP_get_degree() gets the degree of the field. For Fp fields this will be the number of bits in p.  For F2^m fields this will be
-the value m.
+EC_GROUP_get_degree() gets the degree of the field.
+For Fp fields this will be the number of bits in p.
+For F2^m fields this will be the value m.
+
+EC_GROUP_get_field_type() identifies what type of field the EC_GROUP structure supports,
+which will be either F2^m or Fp.
 
 The function EC_GROUP_check_discriminant() calculates the discriminant for the curve and verifies that it is valid.
 For a curve defined over Fp the discriminant is given by the formula 4*a^3 + 27*b^2 whilst for F2^m curves the discriminant is
 
 The function EC_GROUP_check_discriminant() calculates the discriminant for the curve and verifies that it is valid.
 For a curve defined over Fp the discriminant is given by the formula 4*a^3 + 27*b^2 whilst for F2^m curves the discriminant is
@@ -202,6 +209,10 @@ EC_GROUP_get_point_conversion_form() returns the point_conversion_form for B<gro
 
 EC_GROUP_get_degree() returns the degree for B<group> or 0 if the operation is not supported by the underlying group implementation.
 
 
 EC_GROUP_get_degree() returns the degree for B<group> or 0 if the operation is not supported by the underlying group implementation.
 
+EC_GROUP_get_field_type() returns either B<NID_X9_62_prime_field> for prime curves
+or B<NID_X9_62_characteristic_two_field> for binary curves;
+these values are defined in the obj_mac.h header file.
+
 EC_GROUP_check_named_curve() returns the nid of the matching named curve, otherwise it returns 0 for no match, or -1 on error.
 
 EC_GROUP_get0_order() returns an internal pointer to the group order.
 EC_GROUP_check_named_curve() returns the nid of the matching named curve, otherwise it returns 0 for no match, or -1 on error.
 
 EC_GROUP_get0_order() returns an internal pointer to the group order.
@@ -229,7 +240,9 @@ L<EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)>
 
 =head1 HISTORY
 
 
 =head1 HISTORY
 
-The EC_GROUP_check_named_curve() function was added in OpenSSL 3.0.
+EC_GROUP_method_of() was deprecated in OpenSSL 3.0.
+
+EC_GROUP_check_named_curve() and EC_GROUP_get_field_type() were added in OpenSSL 3.0.
 
 =head1 COPYRIGHT
 
 
 =head1 COPYRIGHT
 
index 08bbd80b088375c7c3af1c64161319f749dd551b..7bea1dd0619bc3f7445747341b51fead30c9af84 100644 (file)
@@ -4,7 +4,6 @@
 
 EC_GROUP_get_ecparameters,
 EC_GROUP_get_ecpkparameters,
 
 EC_GROUP_get_ecparameters,
 EC_GROUP_get_ecpkparameters,
-EC_GROUP_new_ex,
 EC_GROUP_new,
 EC_GROUP_new_from_ecparameters,
 EC_GROUP_new_from_ecpkparameters,
 EC_GROUP_new,
 EC_GROUP_new_from_ecparameters,
 EC_GROUP_new_from_ecpkparameters,
@@ -27,8 +26,6 @@ objects
 
  #include <openssl/ec.h>
 
 
  #include <openssl/ec.h>
 
- EC_GROUP *EC_GROUP_new_ex(OPENSSL_CTX *libctx, const EC_METHOD *meth);
- EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
  EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params)
  EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params)
  void EC_GROUP_free(EC_GROUP *group);
  EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params)
  EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params)
  void EC_GROUP_free(EC_GROUP *group);
@@ -62,6 +59,7 @@ Deprecated since OpenSSL 3.0, can be hidden entirely by defining
 B<OPENSSL_API_COMPAT> with a suitable version value, see
 L<openssl_user_macros(7)>:
 
 B<OPENSSL_API_COMPAT> with a suitable version value, see
 L<openssl_user_macros(7)>:
 
+ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
  void EC_GROUP_clear_free(EC_GROUP *group);
 
 =head1 DESCRIPTION
  void EC_GROUP_clear_free(EC_GROUP *group);
 
 =head1 DESCRIPTION
@@ -83,20 +81,20 @@ Operations in a binary field are performed relative to an
 B<irreducible polynomial>. All such curves with OpenSSL use a trinomial or a
 pentanomial for this parameter.
 
 B<irreducible polynomial>. All such curves with OpenSSL use a trinomial or a
 pentanomial for this parameter.
 
-A new curve can be constructed by calling EC_GROUP_new_ex(), using the
+Although deprecated since OpenSSL 3.0 and should no longer be used,
+a new curve can be constructed by calling EC_GROUP_new(), using the
 implementation provided by B<meth> (see L<EC_GFp_simple_method(3)>) and
 associated with the library context B<ctx> (see L<OPENSSL_CTX(3)>).
 The B<ctx> parameter may be NULL in which case the default library context is
 used.
 It is then necessary to call EC_GROUP_set_curve() to set the curve parameters.
 implementation provided by B<meth> (see L<EC_GFp_simple_method(3)>) and
 associated with the library context B<ctx> (see L<OPENSSL_CTX(3)>).
 The B<ctx> parameter may be NULL in which case the default library context is
 used.
 It is then necessary to call EC_GROUP_set_curve() to set the curve parameters.
+Applications should instead use one of the other EC_GROUP_new_* constructors.
+
 EC_GROUP_new_from_ecparameters() will create a group from the
 specified B<params> and
 EC_GROUP_new_from_ecpkparameters() will create a group from the specific PK
 B<params>.
 
 EC_GROUP_new_from_ecparameters() will create a group from the
 specified B<params> and
 EC_GROUP_new_from_ecpkparameters() will create a group from the specific PK
 B<params>.
 
-EC_GROUP_new() is the same as EC_GROUP_new_ex() except that the library context
-used is always the default library context.
-
 EC_GROUP_set_curve() sets the curve parameters B<p>, B<a> and B<b>. For a curve
 over Fp B<p> is the prime for the field. For a curve over F2^m B<p> represents
 the irreducible polynomial - each bit represents a term in the polynomial.
 EC_GROUP_set_curve() sets the curve parameters B<p>, B<a> and B<b>. For a curve
 over Fp B<p> is the prime for the field. For a curve over F2^m B<p> represents
 the irreducible polynomial - each bit represents a term in the polynomial.
@@ -182,7 +180,9 @@ L<OPENSSL_CTX(3)>
 
 =item *
 
 
 =item *
 
-EC_GROUP_new_ex() and EC_GROUP_new_by_curve_name_ex() were added in OpenSSL 3.0.
+EC_GROUP_new() was deprecated in OpenSSL 3.0.
+
+EC_GROUP_new_by_curve_name_ex() was added in OpenSSL 3.0.
 
 =item *
 
 
 =item *
 
index ab02d607cddd1aacfca75b869545f985af39ac44..84b11ee0c08396be3af1d7876ed23984fdcd3a1a 100644 (file)
@@ -38,7 +38,6 @@ EC_POINT_hex2point
  void EC_POINT_clear_free(EC_POINT *point);
  int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
  EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
  void EC_POINT_clear_free(EC_POINT *point);
  int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
  EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
- const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
  int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
  int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
                                      const BIGNUM *x, const BIGNUM *y,
  int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
  int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
                                      const BIGNUM *x, const BIGNUM *y,
@@ -68,6 +67,7 @@ EC_POINT_hex2point
 
 Deprecated since OpenSSL 3.0:
 
 
 Deprecated since OpenSSL 3.0:
 
+ const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
  int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
                                               EC_POINT *p,
                                               const BIGNUM *x, const BIGNUM *y,
  int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
                                               EC_POINT *p,
                                               const BIGNUM *x, const BIGNUM *y,
@@ -116,6 +116,8 @@ EC_POINT_dup() creates a new B<EC_POINT> object and copies the content from
 B<src> to the newly created B<EC_POINT> object.
 
 EC_POINT_method_of() obtains the B<EC_METHOD> associated with B<point>.
 B<src> to the newly created B<EC_POINT> object.
 
 EC_POINT_method_of() obtains the B<EC_METHOD> associated with B<point>.
+This function was deprecated in OpenSSL 3.0, since EC_METHOD is no longer a
+public concept.
 
 A valid point on a curve is the special point at infinity. A point is set to
 be at infinity by calling EC_POINT_set_to_infinity().
 
 A valid point on a curve is the special point at infinity. A point is set to
 be at infinity by calling EC_POINT_set_to_infinity().
@@ -249,6 +251,7 @@ L<EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)>
 
 =head1 HISTORY
 
 
 =head1 HISTORY
 
+EC_POINT_method_of(),
 EC_POINT_set_Jprojective_coordinates_GFp(),
 EC_POINT_get_Jprojective_coordinates_GFp(),
 EC_POINT_set_affine_coordinates_GFp(), EC_POINT_get_affine_coordinates_GFp(),
 EC_POINT_set_Jprojective_coordinates_GFp(),
 EC_POINT_get_Jprojective_coordinates_GFp(),
 EC_POINT_set_affine_coordinates_GFp(), EC_POINT_get_affine_coordinates_GFp(),
index d684e7ca09757418d8b5ed5da78cda3394edeff8..90e109b61e4985eb66938633bd336a933600ad20 100644 (file)
@@ -47,7 +47,9 @@ typedef enum {
     POINT_CONVERSION_HYBRID = 6
 } point_conversion_form_t;
 
     POINT_CONVERSION_HYBRID = 6
 } point_conversion_form_t;
 
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
 typedef struct ec_method_st EC_METHOD;
 typedef struct ec_method_st EC_METHOD;
+#  endif
 typedef struct ec_group_st EC_GROUP;
 typedef struct ec_point_st EC_POINT;
 typedef struct ecpk_parameters_st ECPKPARAMETERS;
 typedef struct ec_group_st EC_GROUP;
 typedef struct ec_point_st EC_POINT;
 typedef struct ecpk_parameters_st ECPKPARAMETERS;
@@ -61,33 +63,33 @@ typedef struct ec_parameters_st ECPARAMETERS;
  *  optimized methods.
  *  \return  EC_METHOD object
  */
  *  optimized methods.
  *  \return  EC_METHOD object
  */
-const EC_METHOD *EC_GFp_simple_method(void);
+DEPRECATEDIN_3_0(const EC_METHOD *EC_GFp_simple_method(void))
 
 /** Returns GFp methods using montgomery multiplication.
  *  \return  EC_METHOD object
  */
 
 /** Returns GFp methods using montgomery multiplication.
  *  \return  EC_METHOD object
  */
-const EC_METHOD *EC_GFp_mont_method(void);
+DEPRECATEDIN_3_0(const EC_METHOD *EC_GFp_mont_method(void))
 
 /** Returns GFp methods using optimized methods for NIST recommended curves
  *  \return  EC_METHOD object
  */
 
 /** Returns GFp methods using optimized methods for NIST recommended curves
  *  \return  EC_METHOD object
  */
-const EC_METHOD *EC_GFp_nist_method(void);
+DEPRECATEDIN_3_0(const EC_METHOD *EC_GFp_nist_method(void))
 
 #  ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
 /** Returns 64-bit optimized methods for nistp224
  *  \return  EC_METHOD object
  */
 
 #  ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
 /** Returns 64-bit optimized methods for nistp224
  *  \return  EC_METHOD object
  */
-const EC_METHOD *EC_GFp_nistp224_method(void);
+DEPRECATEDIN_3_0(const EC_METHOD *EC_GFp_nistp224_method(void))
 
 /** Returns 64-bit optimized methods for nistp256
  *  \return  EC_METHOD object
  */
 
 /** Returns 64-bit optimized methods for nistp256
  *  \return  EC_METHOD object
  */
-const EC_METHOD *EC_GFp_nistp256_method(void);
+DEPRECATEDIN_3_0(const EC_METHOD *EC_GFp_nistp256_method(void))
 
 /** Returns 64-bit optimized methods for nistp521
  *  \return  EC_METHOD object
  */
 
 /** Returns 64-bit optimized methods for nistp521
  *  \return  EC_METHOD object
  */
-const EC_METHOD *EC_GFp_nistp521_method(void);
+DEPRECATEDIN_3_0(const EC_METHOD *EC_GFp_nistp521_method(void))
 #  endif
 
 #  ifndef OPENSSL_NO_EC2M
 #  endif
 
 #  ifndef OPENSSL_NO_EC2M
@@ -98,7 +100,7 @@ const EC_METHOD *EC_GFp_nistp521_method(void);
 /** Returns the basic GF2m ec method
  *  \return  EC_METHOD object
  */
 /** Returns the basic GF2m ec method
  *  \return  EC_METHOD object
  */
-const EC_METHOD *EC_GF2m_simple_method(void);
+DEPRECATEDIN_3_0(const EC_METHOD *EC_GF2m_simple_method(void))
 
 #  endif
 
 
 #  endif
 
@@ -108,20 +110,10 @@ const EC_METHOD *EC_GF2m_simple_method(void);
 
 /**
  *  Creates a new EC_GROUP object
 
 /**
  *  Creates a new EC_GROUP object
- *  \param   libctx The associated library context or NULL for the default
- *                  library context
  *  \param   meth   EC_METHOD to use
  *  \return  newly created EC_GROUP object or NULL in case of an error.
  */
  *  \param   meth   EC_METHOD to use
  *  \return  newly created EC_GROUP object or NULL in case of an error.
  */
-EC_GROUP *EC_GROUP_new_ex(OPENSSL_CTX *libctx, const EC_METHOD *meth);
-
-/**
- *  Creates a new EC_GROUP object. Same as EC_GROUP_new_ex with NULL for the
- *  library context.
- *  \param   meth   EC_METHOD to use
- *  \return  newly created EC_GROUP object or NULL in case of an error.
- */
-EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
+DEPRECATEDIN_3_0(EC_GROUP *EC_GROUP_new(const EC_METHOD *meth))
 
 /** Frees a EC_GROUP object
  *  \param  group  EC_GROUP object to be freed.
 
 /** Frees a EC_GROUP object
  *  \param  group  EC_GROUP object to be freed.
@@ -151,13 +143,13 @@ EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
  *  \param  group  EC_GROUP object
  *  \return EC_METHOD used in this EC_GROUP object.
  */
  *  \param  group  EC_GROUP object
  *  \return EC_METHOD used in this EC_GROUP object.
  */
-const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
+DEPRECATEDIN_3_0(const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group))
 
 /** Returns the field type of the EC_METHOD.
  *  \param  meth  EC_METHOD object
  *  \return NID of the underlying field type OID.
  */
 
 /** Returns the field type of the EC_METHOD.
  *  \param  meth  EC_METHOD object
  *  \return NID of the underlying field type OID.
  */
-int EC_METHOD_get_field_type(const EC_METHOD *meth);
+DEPRECATEDIN_3_0(int EC_METHOD_get_field_type(const EC_METHOD *meth))
 
 /** Sets the generator and its order/cofactor of a EC_GROUP object.
  *  \param  group      EC_GROUP object
 
 /** Sets the generator and its order/cofactor of a EC_GROUP object.
  *  \param  group      EC_GROUP object
@@ -235,6 +227,12 @@ int EC_GROUP_get_curve_name(const EC_GROUP *group);
  */
 const BIGNUM *EC_GROUP_get0_field(const EC_GROUP *group);
 
  */
 const BIGNUM *EC_GROUP_get0_field(const EC_GROUP *group);
 
+/** Returns the field type of the EC_GROUP.
+ *  \param  group  EC_GROUP object
+ *  \return NID of the underlying field type OID.
+ */
+int EC_GROUP_get_field_type(const EC_GROUP *group);
+
 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
 int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
 
 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
 int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
 
@@ -493,7 +491,7 @@ EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
  *  \param  point  EC_POINT object
  *  \return the EC_METHOD used
  */
  *  \param  point  EC_POINT object
  *  \return the EC_METHOD used
  */
-const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
+DEPRECATEDIN_3_0(const EC_METHOD *EC_POINT_method_of(const EC_POINT *point))
 
 /** Sets a point to infinity (neutral element)
  *  \param  group  underlying EC_GROUP object
 
 /** Sets a point to infinity (neutral element)
  *  \param  group  underlying EC_GROUP object
index f3373dc6d55039e6f16c415c13537cb0ae844b2c..5afe53acfc1ab02962d79326d3a01889d20e9700 100644 (file)
@@ -621,7 +621,7 @@ static int tls1_check_pkey_comp(SSL *s, EVP_PKEY *pkey)
              */
             return 1;
     } else {
              */
             return 1;
     } else {
-        int field_type = EC_METHOD_get_field_type(EC_GROUP_method_of(grp));
+        int field_type = EC_GROUP_get_field_type(grp);
 
         if (field_type == NID_X9_62_prime_field)
             comp_id = TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime;
 
         if (field_type == NID_X9_62_prime_field)
             comp_id = TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime;
index f4ccdfb4c116979e351f6a83b863eac680c0d9ab..2fdf339271d051a3ee535dc9ee2f4acb8dcc79d9 100644 (file)
@@ -161,9 +161,7 @@ static int prime_field_tests(void)
 {
     BN_CTX *ctx = NULL;
     BIGNUM *p = NULL, *a = NULL, *b = NULL, *scalar3 = NULL;
 {
     BN_CTX *ctx = NULL;
     BIGNUM *p = NULL, *a = NULL, *b = NULL, *scalar3 = NULL;
-    EC_GROUP *group = NULL, *tmp = NULL;
-    EC_GROUP *P_160 = NULL, *P_192 = NULL, *P_224 = NULL,
-             *P_256 = NULL, *P_384 = NULL, *P_521 = NULL;
+    EC_GROUP *group = NULL;
     EC_POINT *P = NULL, *Q = NULL, *R = NULL;
     BIGNUM *x = NULL, *y = NULL, *z = NULL, *yplusone = NULL;
 # ifndef OPENSSL_NO_DEPRECATED_3_0
     EC_POINT *P = NULL, *Q = NULL, *R = NULL;
     BIGNUM *x = NULL, *y = NULL, *z = NULL, *yplusone = NULL;
 # ifndef OPENSSL_NO_DEPRECATED_3_0
@@ -181,20 +179,8 @@ static int prime_field_tests(void)
         || !TEST_true(BN_hex2bn(&p, "17"))
         || !TEST_true(BN_hex2bn(&a, "1"))
         || !TEST_true(BN_hex2bn(&b, "1"))
         || !TEST_true(BN_hex2bn(&p, "17"))
         || !TEST_true(BN_hex2bn(&a, "1"))
         || !TEST_true(BN_hex2bn(&b, "1"))
-        /*
-         * applications should use EC_GROUP_new_curve_GFp so
-         * that the library gets to choose the EC_METHOD
-         */
-        || !TEST_ptr(group = EC_GROUP_new(EC_GFp_mont_method()))
-        || !TEST_true(EC_GROUP_set_curve(group, p, a, b, ctx))
-        || !TEST_ptr(tmp = EC_GROUP_new(EC_GROUP_method_of(group)))
-        || !TEST_true(EC_GROUP_copy(tmp, group)))
-        goto err;
-    EC_GROUP_free(group);
-    group = tmp;
-    tmp = NULL;
-
-    if (!TEST_true(EC_GROUP_get_curve(group, p, a, b, ctx)))
+        || !TEST_ptr(group = EC_GROUP_new_curve_GFp(p, a, b, ctx))
+        || !TEST_true(EC_GROUP_get_curve(group, p, a, b, ctx)))
         goto err;
 
     TEST_info("Curve defined by Weierstrass equation");
         goto err;
 
     TEST_info("Curve defined by Weierstrass equation");
@@ -327,8 +313,6 @@ static int prime_field_tests(void)
         || !TEST_BN_eq(y, z)
         || !TEST_int_eq(EC_GROUP_get_degree(group), 160)
         || !group_order_tests(group)
         || !TEST_BN_eq(y, z)
         || !TEST_int_eq(EC_GROUP_get_degree(group), 160)
         || !group_order_tests(group)
-        || !TEST_ptr(P_160 = EC_GROUP_new(EC_GROUP_method_of(group)))
-        || !TEST_true(EC_GROUP_copy(P_160, group))
 
     /* Curve P-192 (FIPS PUB 186-2, App. 6) */
 
 
     /* Curve P-192 (FIPS PUB 186-2, App. 6) */
 
@@ -366,8 +350,6 @@ static int prime_field_tests(void)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 192)
         || !group_order_tests(group)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 192)
         || !group_order_tests(group)
-        || !TEST_ptr(P_192 = EC_GROUP_new(EC_GROUP_method_of(group)))
-        || !TEST_true(EC_GROUP_copy(P_192, group))
 
     /* Curve P-224 (FIPS PUB 186-2, App. 6) */
 
 
     /* Curve P-224 (FIPS PUB 186-2, App. 6) */
 
@@ -405,8 +387,6 @@ static int prime_field_tests(void)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 224)
         || !group_order_tests(group)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 224)
         || !group_order_tests(group)
-        || !TEST_ptr(P_224 = EC_GROUP_new(EC_GROUP_method_of(group)))
-        || !TEST_true(EC_GROUP_copy(P_224, group))
 
     /* Curve P-256 (FIPS PUB 186-2, App. 6) */
 
 
     /* Curve P-256 (FIPS PUB 186-2, App. 6) */
 
@@ -445,8 +425,6 @@ static int prime_field_tests(void)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 256)
         || !group_order_tests(group)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 256)
         || !group_order_tests(group)
-        || !TEST_ptr(P_256 = EC_GROUP_new(EC_GROUP_method_of(group)))
-        || !TEST_true(EC_GROUP_copy(P_256, group))
 
     /* Curve P-384 (FIPS PUB 186-2, App. 6) */
 
 
     /* Curve P-384 (FIPS PUB 186-2, App. 6) */
 
@@ -491,8 +469,6 @@ static int prime_field_tests(void)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 384)
         || !group_order_tests(group)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 384)
         || !group_order_tests(group)
-        || !TEST_ptr(P_384 = EC_GROUP_new(EC_GROUP_method_of(group)))
-        || !TEST_true(EC_GROUP_copy(P_384, group))
 
     /* Curve P-521 (FIPS PUB 186-2, App. 6) */
         || !TEST_true(BN_hex2bn(&p,                              "1FF"
 
     /* Curve P-521 (FIPS PUB 186-2, App. 6) */
         || !TEST_true(BN_hex2bn(&p,                              "1FF"
@@ -547,8 +523,6 @@ static int prime_field_tests(void)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 521)
         || !group_order_tests(group)
                                                        ctx))
         || !TEST_int_eq(EC_GROUP_get_degree(group), 521)
         || !group_order_tests(group)
-        || !TEST_ptr(P_521 = EC_GROUP_new(EC_GROUP_method_of(group)))
-        || !TEST_true(EC_GROUP_copy(P_521, group))
 
     /* more tests using the last curve */
 
 
     /* more tests using the last curve */
 
@@ -620,7 +594,6 @@ err:
     BN_free(a);
     BN_free(b);
     EC_GROUP_free(group);
     BN_free(a);
     BN_free(b);
     EC_GROUP_free(group);
-    EC_GROUP_free(tmp);
     EC_POINT_free(P);
     EC_POINT_free(Q);
     EC_POINT_free(R);
     EC_POINT_free(P);
     EC_POINT_free(Q);
     EC_POINT_free(R);
@@ -629,13 +602,6 @@ err:
     BN_free(z);
     BN_free(yplusone);
     BN_free(scalar3);
     BN_free(z);
     BN_free(yplusone);
     BN_free(scalar3);
-
-    EC_GROUP_free(P_160);
-    EC_GROUP_free(P_192);
-    EC_GROUP_free(P_224);
-    EC_GROUP_free(P_256);
-    EC_GROUP_free(P_384);
-    EC_GROUP_free(P_521);
     return r;
 }
 
     return r;
 }
 
@@ -817,7 +783,7 @@ static int char2_curve_test(int n)
     BN_CTX *ctx = NULL;
     BIGNUM *p = NULL, *a = NULL, *b = NULL;
     BIGNUM *x = NULL, *y = NULL, *z = NULL, *cof = NULL, *yplusone = NULL;
     BN_CTX *ctx = NULL;
     BIGNUM *p = NULL, *a = NULL, *b = NULL;
     BIGNUM *x = NULL, *y = NULL, *z = NULL, *cof = NULL, *yplusone = NULL;
-    EC_GROUP *group = NULL, *variable = NULL;
+    EC_GROUP *group = NULL;
     EC_POINT *P = NULL, *Q = NULL, *R = NULL;
 # ifndef OPENSSL_NO_DEPRECATED_3_0
     const EC_POINT *points[3];
     EC_POINT *P = NULL, *Q = NULL, *R = NULL;
 # ifndef OPENSSL_NO_DEPRECATED_3_0
     const EC_POINT *points[3];
@@ -836,8 +802,7 @@ static int char2_curve_test(int n)
         || !TEST_true(BN_hex2bn(&p, test->p))
         || !TEST_true(BN_hex2bn(&a, test->a))
         || !TEST_true(BN_hex2bn(&b, test->b))
         || !TEST_true(BN_hex2bn(&p, test->p))
         || !TEST_true(BN_hex2bn(&a, test->a))
         || !TEST_true(BN_hex2bn(&b, test->b))
-        || !TEST_true(group = EC_GROUP_new(EC_GF2m_simple_method()))
-        || !TEST_true(EC_GROUP_set_curve(group, p, a, b, ctx))
+        || !TEST_true(group = EC_GROUP_new_curve_GF2m(p, a, b, ctx))
         || !TEST_ptr(P = EC_POINT_new(group))
         || !TEST_ptr(Q = EC_POINT_new(group))
         || !TEST_ptr(R = EC_POINT_new(group))
         || !TEST_ptr(P = EC_POINT_new(group))
         || !TEST_ptr(Q = EC_POINT_new(group))
         || !TEST_ptr(R = EC_POINT_new(group))
@@ -887,9 +852,7 @@ static int char2_curve_test(int n)
 # endif
 
     if (!TEST_int_eq(EC_GROUP_get_degree(group), test->degree)
 # endif
 
     if (!TEST_int_eq(EC_GROUP_get_degree(group), test->degree)
-        || !group_order_tests(group)
-        || !TEST_ptr(variable = EC_GROUP_new(EC_GROUP_method_of(group)))
-        || !TEST_true(EC_GROUP_copy(variable, group)))
+        || !group_order_tests(group))
         goto err;
 
     /* more tests using the last curve */
         goto err;
 
     /* more tests using the last curve */
@@ -966,7 +929,6 @@ err:
     EC_POINT_free(Q);
     EC_POINT_free(R);
     EC_GROUP_free(group);
     EC_POINT_free(Q);
     EC_POINT_free(R);
     EC_GROUP_free(group);
-    EC_GROUP_free(variable);
     return r;
 }
 
     return r;
 }
 
@@ -974,7 +936,7 @@ static int char2_field_tests(void)
 {
     BN_CTX *ctx = NULL;
     BIGNUM *p = NULL, *a = NULL, *b = NULL;
 {
     BN_CTX *ctx = NULL;
     BIGNUM *p = NULL, *a = NULL, *b = NULL;
-    EC_GROUP *group = NULL, *tmp = NULL;
+    EC_GROUP *group = NULL;
     EC_POINT *P = NULL, *Q = NULL, *R = NULL;
     BIGNUM *x = NULL, *y = NULL, *z = NULL, *cof = NULL, *yplusone = NULL;
     unsigned char buf[100];
     EC_POINT *P = NULL, *Q = NULL, *R = NULL;
     BIGNUM *x = NULL, *y = NULL, *z = NULL, *cof = NULL, *yplusone = NULL;
     unsigned char buf[100];
@@ -990,20 +952,8 @@ static int char2_field_tests(void)
         || !TEST_true(BN_hex2bn(&b, "1")))
         goto err;
 
         || !TEST_true(BN_hex2bn(&b, "1")))
         goto err;
 
-    group = EC_GROUP_new(EC_GF2m_simple_method()); /* applications should use
-                                                    * EC_GROUP_new_curve_GF2m
-                                                    * so that the library gets
-                                                    * to choose the EC_METHOD */
-    if (!TEST_ptr(group)
-        || !TEST_true(EC_GROUP_set_curve(group, p, a, b, ctx))
-        || !TEST_ptr(tmp = EC_GROUP_new(EC_GROUP_method_of(group)))
-        || !TEST_true(EC_GROUP_copy(tmp, group)))
-        goto err;
-    EC_GROUP_free(group);
-    group = tmp;
-    tmp = NULL;
-
-    if (!TEST_true(EC_GROUP_get_curve(group, p, a, b, ctx)))
+    if (!TEST_ptr(group = EC_GROUP_new_curve_GF2m(p, a, b, ctx))
+        || !TEST_true(EC_GROUP_get_curve(group, p, a, b, ctx)))
         goto err;
 
     TEST_info("Curve defined by Weierstrass equation");
         goto err;
 
     TEST_info("Curve defined by Weierstrass equation");
@@ -1124,7 +1074,6 @@ err:
     BN_free(a);
     BN_free(b);
     EC_GROUP_free(group);
     BN_free(a);
     BN_free(b);
     EC_GROUP_free(group);
-    EC_GROUP_free(tmp);
     EC_POINT_free(P);
     EC_POINT_free(Q);
     EC_POINT_free(R);
     EC_POINT_free(P);
     EC_POINT_free(Q);
     EC_POINT_free(R);
@@ -1207,13 +1156,12 @@ static int group_field_test(void)
     return r;
 }
 
     return r;
 }
 
-# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
 /*
 /*
- * nistp_test_params contains magic numbers for testing our optimized
- * implementations of several NIST curves with characteristic > 3.
+ * nistp_test_params contains magic numbers for testing
+ * several NIST curves with characteristic > 3.
  */
 struct nistp_test_params {
  */
 struct nistp_test_params {
-    const EC_METHOD *(*meth) (void);
+    const int nid;
     int degree;
     /*
      * Qx, Qy and D are taken from
     int degree;
     /*
      * Qx, Qy and D are taken from
@@ -1226,7 +1174,7 @@ struct nistp_test_params {
 static const struct nistp_test_params nistp_tests_params[] = {
     {
      /* P-224 */
 static const struct nistp_test_params nistp_tests_params[] = {
     {
      /* P-224 */
-     EC_GFp_nistp224_method,
+     NID_secp224r1,
      224,
      /* p */
      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001",
      224,
      /* p */
      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001",
@@ -1249,7 +1197,7 @@ static const struct nistp_test_params nistp_tests_params[] = {
      },
     {
      /* P-256 */
      },
     {
      /* P-256 */
-     EC_GFp_nistp256_method,
+     NID_X9_62_prime256v1,
      256,
      /* p */
      "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
      256,
      /* p */
      "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
@@ -1272,7 +1220,7 @@ static const struct nistp_test_params nistp_tests_params[] = {
      },
     {
      /* P-521 */
      },
     {
      /* P-521 */
-     EC_GFp_nistp521_method,
+     NID_secp521r1,
      521,
      /* p */
                                                                   "1ff"
      521,
      /* p */
                                                                   "1ff"
@@ -1336,7 +1284,7 @@ static int nistp_single_test(int idx)
         || !TEST_ptr(order = BN_new())
         || !TEST_ptr(yplusone = BN_new())
 
         || !TEST_ptr(order = BN_new())
         || !TEST_ptr(yplusone = BN_new())
 
-        || !TEST_ptr(NISTP = EC_GROUP_new(test->meth()))
+        || !TEST_ptr(NISTP = EC_GROUP_new_by_curve_name(test->nid))
         || !TEST_true(BN_hex2bn(&p, test->p))
         || !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
         || !TEST_true(BN_hex2bn(&a, test->a))
         || !TEST_true(BN_hex2bn(&p, test->p))
         || !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
         || !TEST_true(BN_hex2bn(&a, test->a))
@@ -1396,7 +1344,6 @@ static int nistp_single_test(int idx)
         || !TEST_false(EC_GROUP_have_precompute_mult(NISTP))
         /* now repeat all tests with precomputation */
         || !TEST_true(EC_GROUP_precompute_mult(NISTP, ctx))
         || !TEST_false(EC_GROUP_have_precompute_mult(NISTP))
         /* now repeat all tests with precomputation */
         || !TEST_true(EC_GROUP_precompute_mult(NISTP, ctx))
-        || !TEST_true(EC_GROUP_have_precompute_mult(NISTP))
 # endif
         )
         goto err;
 # endif
         )
         goto err;
@@ -1430,7 +1377,7 @@ static int nistp_single_test(int idx)
         || !TEST_int_eq(0, EC_POINT_cmp(NISTP, Q, G, ctx)))
       goto err;
 
         || !TEST_int_eq(0, EC_POINT_cmp(NISTP, Q, G, ctx)))
       goto err;
 
-    r = group_order_tests(NISTP);
+    r = 1;
 err:
     EC_GROUP_free(NISTP);
     EC_POINT_free(G);
 err:
     EC_GROUP_free(NISTP);
     EC_POINT_free(G);
@@ -1449,7 +1396,6 @@ err:
     BN_CTX_free(ctx);
     return r;
 }
     BN_CTX_free(ctx);
     return r;
 }
-# endif
 
 static const unsigned char p521_named[] = {
     0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x23,
 
 static const unsigned char p521_named[] = {
     0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x23,
@@ -1543,7 +1489,7 @@ static int check_named_curve_test(int id)
 
     /* Determine if the built-in curve has a seed field set */
     has_seed = (EC_GROUP_get_seed_len(group) > 0);
 
     /* Determine if the built-in curve has a seed field set */
     has_seed = (EC_GROUP_get_seed_len(group) > 0);
-    field_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
+    field_nid = EC_GROUP_get_field_type(group);
     if (field_nid == NID_X9_62_characteristic_two_field) {
         if (!TEST_ptr(other_p = BN_dup(group_p))
             || !TEST_true(BN_lshift1(other_p, other_p)))
     if (field_nid == NID_X9_62_characteristic_two_field) {
         if (!TEST_ptr(other_p = BN_dup(group_p))
             || !TEST_true(BN_lshift1(other_p, other_p)))
@@ -2158,7 +2104,7 @@ static int cofactor_range_test(void)
  */
 static int cardinality_test(int n)
 {
  */
 static int cardinality_test(int n)
 {
-    int ret = 0;
+    int ret = 0, is_binary = 0;
     int nid = curves[n].nid;
     BN_CTX *ctx = NULL;
     EC_GROUP *g1 = NULL, *g2 = NULL;
     int nid = curves[n].nid;
     BN_CTX *ctx = NULL;
     EC_GROUP *g1 = NULL, *g2 = NULL;
@@ -2169,14 +2115,13 @@ static int cardinality_test(int n)
     TEST_info("Curve %s cardinality test", OBJ_nid2sn(nid));
 
     if (!TEST_ptr(ctx = BN_CTX_new())
     TEST_info("Curve %s cardinality test", OBJ_nid2sn(nid));
 
     if (!TEST_ptr(ctx = BN_CTX_new())
-        || !TEST_ptr(g1 = EC_GROUP_new_by_curve_name(nid))
-        || !TEST_ptr(g2 = EC_GROUP_new(EC_GROUP_method_of(g1)))) {
-        EC_GROUP_free(g1);
-        EC_GROUP_free(g2);
+        || !TEST_ptr(g1 = EC_GROUP_new_by_curve_name(nid))) {
         BN_CTX_free(ctx);
         return 0;
     }
 
         BN_CTX_free(ctx);
         return 0;
     }
 
+    is_binary = (EC_GROUP_get_field_type(g1) == NID_X9_62_characteristic_two_field);
+
     BN_CTX_start(ctx);
     g1_p = BN_CTX_get(ctx);
     g1_a = BN_CTX_get(ctx);
     BN_CTX_start(ctx);
     g1_p = BN_CTX_get(ctx);
     g1_a = BN_CTX_get(ctx);
@@ -2194,7 +2139,14 @@ static int cardinality_test(int n)
         || !TEST_true(BN_copy(g1_order, EC_GROUP_get0_order(g1)))
         || !TEST_true(EC_GROUP_get_cofactor(g1, g1_cf, ctx))
         /* construct g2 manually with g1 parameters */
         || !TEST_true(BN_copy(g1_order, EC_GROUP_get0_order(g1)))
         || !TEST_true(EC_GROUP_get_cofactor(g1, g1_cf, ctx))
         /* construct g2 manually with g1 parameters */
-        || !TEST_true(EC_GROUP_set_curve(g2, g1_p, g1_a, g1_b, ctx))
+# ifndef OPENSSL_NO_EC2M
+        || !TEST_ptr(g2 = (is_binary) ?
+                           EC_GROUP_new_curve_GF2m(g1_p, g1_a, g1_b, ctx) :
+                           EC_GROUP_new_curve_GFp(g1_p, g1_a, g1_b, ctx))
+# else
+        || !TEST_int_eq(0, is_binary)
+        || !TEST_ptr(g2 = EC_GROUP_new_curve_GFp(g1_p, g1_a, g1_b, ctx))
+# endif
         || !TEST_ptr(g2_gen = EC_POINT_new(g2))
         || !TEST_true(EC_POINT_set_affine_coordinates(g2, g2_gen, g1_x, g1_y, ctx))
         /* pass NULL cofactor: lib should compute it */
         || !TEST_ptr(g2_gen = EC_POINT_new(g2))
         || !TEST_true(EC_POINT_set_affine_coordinates(g2, g2_gen, g1_x, g1_y, ctx))
         /* pass NULL cofactor: lib should compute it */
@@ -2238,7 +2190,6 @@ static int check_ec_key_field_public_range_test(int id)
     int ret = 0, type = 0;
     const EC_POINT *pub = NULL;
     const EC_GROUP *group = NULL;
     int ret = 0, type = 0;
     const EC_POINT *pub = NULL;
     const EC_GROUP *group = NULL;
-    const EC_METHOD *meth = NULL;
     const BIGNUM *field = NULL;
     BIGNUM *x = NULL, *y = NULL;
     EC_KEY *key = NULL;
     const BIGNUM *field = NULL;
     BIGNUM *x = NULL, *y = NULL;
     EC_KEY *key = NULL;
@@ -2247,7 +2198,6 @@ static int check_ec_key_field_public_range_test(int id)
             || !TEST_ptr(y = BN_new())
             || !TEST_ptr(key = EC_KEY_new_by_curve_name(curves[id].nid))
             || !TEST_ptr(group = EC_KEY_get0_group(key))
             || !TEST_ptr(y = BN_new())
             || !TEST_ptr(key = EC_KEY_new_by_curve_name(curves[id].nid))
             || !TEST_ptr(group = EC_KEY_get0_group(key))
-            || !TEST_ptr(meth = EC_GROUP_method_of(group))
             || !TEST_ptr(field = EC_GROUP_get0_field(group))
             || !TEST_int_gt(EC_KEY_generate_key(key), 0)
             || !TEST_int_gt(EC_KEY_check_key(key), 0)
             || !TEST_ptr(field = EC_GROUP_get0_field(group))
             || !TEST_int_gt(EC_KEY_generate_key(key), 0)
             || !TEST_int_gt(EC_KEY_check_key(key), 0)
@@ -2260,7 +2210,7 @@ static int check_ec_key_field_public_range_test(int id)
      * Make the public point out of range by adding the field (which will still
      * be the same point on the curve). The add is different for char2 fields.
      */
      * Make the public point out of range by adding the field (which will still
      * be the same point on the curve). The add is different for char2 fields.
      */
-    type = EC_METHOD_get_field_type(meth);
+    type = EC_GROUP_get_field_type(group);
 #ifndef OPENSSL_NO_EC2M
     if (type == NID_X9_62_characteristic_two_field) {
         /* test for binary curves */
 #ifndef OPENSSL_NO_EC2M
     if (type == NID_X9_62_characteristic_two_field) {
         /* test for binary curves */
@@ -2405,9 +2355,7 @@ int setup_tests(void)
     ADD_TEST(char2_field_tests);
     ADD_ALL_TESTS(char2_curve_test, OSSL_NELEM(char2_curve_tests));
 # endif
     ADD_TEST(char2_field_tests);
     ADD_ALL_TESTS(char2_curve_test, OSSL_NELEM(char2_curve_tests));
 # endif
-# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
     ADD_ALL_TESTS(nistp_single_test, OSSL_NELEM(nistp_tests_params));
     ADD_ALL_TESTS(nistp_single_test, OSSL_NELEM(nistp_tests_params));
-# endif
     ADD_ALL_TESTS(internal_curve_test, crv_len);
     ADD_ALL_TESTS(internal_curve_test_method, crv_len);
     ADD_TEST(group_field_test);
     ADD_ALL_TESTS(internal_curve_test, crv_len);
     ADD_ALL_TESTS(internal_curve_test_method, crv_len);
     ADD_TEST(group_field_test);
index 1a511323877c8410e06e0fe0eee0f0b7dc382c23..fd0509172f9a1503a593ef69581d4d30a3a4c782 100644 (file)
@@ -40,7 +40,7 @@ X509_NAME_delete_entry                  40    3_0_0   EXIST::FUNCTION:
 EVP_PKEY_meth_set_verify_recover        41     3_0_0   EXIST::FUNCTION:
 UI_set_method                           42     3_0_0   EXIST::FUNCTION:
 PKCS7_ISSUER_AND_SERIAL_it              43     3_0_0   EXIST::FUNCTION:
 EVP_PKEY_meth_set_verify_recover        41     3_0_0   EXIST::FUNCTION:
 UI_set_method                           42     3_0_0   EXIST::FUNCTION:
 PKCS7_ISSUER_AND_SERIAL_it              43     3_0_0   EXIST::FUNCTION:
-EC_GROUP_method_of                      44     3_0_0   EXIST::FUNCTION:EC
+EC_GROUP_method_of                      44     3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
 RSA_blinding_on                         45     3_0_0   EXIST::FUNCTION:RSA
 X509_get0_signature                     47     3_0_0   EXIST::FUNCTION:
 X509_REVOKED_get0_extensions            48     3_0_0   EXIST::FUNCTION:
 RSA_blinding_on                         45     3_0_0   EXIST::FUNCTION:RSA
 X509_get0_signature                     47     3_0_0   EXIST::FUNCTION:
 X509_REVOKED_get0_extensions            48     3_0_0   EXIST::FUNCTION:
@@ -1181,7 +1181,7 @@ PKCS7_add_attribute                     1207      3_0_0   EXIST::FUNCTION:
 ENGINE_register_DSA                     1208   3_0_0   EXIST::FUNCTION:ENGINE
 OPENSSL_LH_node_stats                   1209   3_0_0   EXIST::FUNCTION:STDIO
 X509_policy_tree_free                   1210   3_0_0   EXIST::FUNCTION:
 ENGINE_register_DSA                     1208   3_0_0   EXIST::FUNCTION:ENGINE
 OPENSSL_LH_node_stats                   1209   3_0_0   EXIST::FUNCTION:STDIO
 X509_policy_tree_free                   1210   3_0_0   EXIST::FUNCTION:
-EC_GFp_simple_method                    1211   3_0_0   EXIST::FUNCTION:EC
+EC_GFp_simple_method                    1211   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
 X509_it                                 1212   3_0_0   EXIST::FUNCTION:
 d2i_PROXY_POLICY                        1213   3_0_0   EXIST::FUNCTION:
 MDC2_Update                             1214   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
 X509_it                                 1212   3_0_0   EXIST::FUNCTION:
 d2i_PROXY_POLICY                        1213   3_0_0   EXIST::FUNCTION:
 MDC2_Update                             1214   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
@@ -1197,7 +1197,7 @@ X509_time_adj                           1223      3_0_0   EXIST::FUNCTION:
 EVP_PKEY_asn1_find_str                  1224   3_0_0   EXIST::FUNCTION:
 X509_VERIFY_PARAM_get_flags             1225   3_0_0   EXIST::FUNCTION:
 OPENSSL_DIR_end                         1226   3_0_0   EXIST::FUNCTION:
 EVP_PKEY_asn1_find_str                  1224   3_0_0   EXIST::FUNCTION:
 X509_VERIFY_PARAM_get_flags             1225   3_0_0   EXIST::FUNCTION:
 OPENSSL_DIR_end                         1226   3_0_0   EXIST::FUNCTION:
-EC_GROUP_new                            1227   3_0_0   EXIST::FUNCTION:EC
+EC_GROUP_new                            1227   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
 CMS_SignerInfo_get0_pkey_ctx            1228   3_0_0   EXIST::FUNCTION:CMS
 d2i_ASN1_PRINTABLESTRING                1229   3_0_0   EXIST::FUNCTION:
 CMS_RecipientInfo_ktri_cert_cmp         1230   3_0_0   EXIST::FUNCTION:CMS
 CMS_SignerInfo_get0_pkey_ctx            1228   3_0_0   EXIST::FUNCTION:CMS
 d2i_ASN1_PRINTABLESTRING                1229   3_0_0   EXIST::FUNCTION:
 CMS_RecipientInfo_ktri_cert_cmp         1230   3_0_0   EXIST::FUNCTION:CMS
@@ -2116,7 +2116,7 @@ EVP_MD_flags                            2161      3_0_0   EXIST::FUNCTION:
 OPENSSL_sk_set                          2162   3_0_0   EXIST::FUNCTION:
 OCSP_request_sign                       2163   3_0_0   EXIST::FUNCTION:OCSP
 BN_GF2m_mod_solve_quad                  2164   3_0_0   EXIST::FUNCTION:EC2M
 OPENSSL_sk_set                          2162   3_0_0   EXIST::FUNCTION:
 OCSP_request_sign                       2163   3_0_0   EXIST::FUNCTION:OCSP
 BN_GF2m_mod_solve_quad                  2164   3_0_0   EXIST::FUNCTION:EC2M
-EC_POINT_method_of                      2165   3_0_0   EXIST::FUNCTION:EC
+EC_POINT_method_of                      2165   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
 PKCS7_ENCRYPT_it                        2166   3_0_0   EXIST::FUNCTION:
 AUTHORITY_INFO_ACCESS_it                2167   3_0_0   EXIST::FUNCTION:
 X509_EXTENSION_create_by_NID            2168   3_0_0   EXIST::FUNCTION:
 PKCS7_ENCRYPT_it                        2166   3_0_0   EXIST::FUNCTION:
 AUTHORITY_INFO_ACCESS_it                2167   3_0_0   EXIST::FUNCTION:
 X509_EXTENSION_create_by_NID            2168   3_0_0   EXIST::FUNCTION:
@@ -2183,7 +2183,7 @@ POLICY_CONSTRAINTS_new                  2230      3_0_0   EXIST::FUNCTION:
 OTHERNAME_new                           2231   3_0_0   EXIST::FUNCTION:
 BN_rshift                               2232   3_0_0   EXIST::FUNCTION:
 i2d_GENERAL_NAMES                       2233   3_0_0   EXIST::FUNCTION:
 OTHERNAME_new                           2231   3_0_0   EXIST::FUNCTION:
 BN_rshift                               2232   3_0_0   EXIST::FUNCTION:
 i2d_GENERAL_NAMES                       2233   3_0_0   EXIST::FUNCTION:
-EC_METHOD_get_field_type                2234   3_0_0   EXIST::FUNCTION:EC
+EC_METHOD_get_field_type                2234   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
 ENGINE_set_name                         2235   3_0_0   EXIST::FUNCTION:ENGINE
 TS_TST_INFO_get_policy_id               2236   3_0_0   EXIST::FUNCTION:TS
 PKCS7_SIGNER_INFO_set                   2237   3_0_0   EXIST::FUNCTION:
 ENGINE_set_name                         2235   3_0_0   EXIST::FUNCTION:ENGINE
 TS_TST_INFO_get_policy_id               2236   3_0_0   EXIST::FUNCTION:TS
 PKCS7_SIGNER_INFO_set                   2237   3_0_0   EXIST::FUNCTION:
@@ -2607,7 +2607,7 @@ EVP_PKEY_assign                         2662      3_0_0   EXIST::FUNCTION:
 EVP_aes_128_ofb                         2663   3_0_0   EXIST::FUNCTION:
 CMS_data                                2664   3_0_0   EXIST::FUNCTION:CMS
 X509_load_cert_file                     2665   3_0_0   EXIST::FUNCTION:
 EVP_aes_128_ofb                         2663   3_0_0   EXIST::FUNCTION:
 CMS_data                                2664   3_0_0   EXIST::FUNCTION:CMS
 X509_load_cert_file                     2665   3_0_0   EXIST::FUNCTION:
-EC_GFp_nistp521_method                  2667   3_0_0   EXIST::FUNCTION:EC,EC_NISTP_64_GCC_128
+EC_GFp_nistp521_method                  2667   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC_NISTP_64_GCC_128
 ECDSA_SIG_free                          2668   3_0_0   EXIST::FUNCTION:EC
 d2i_PKCS12_BAGS                         2669   3_0_0   EXIST::FUNCTION:
 RSA_public_encrypt                      2670   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,RSA
 ECDSA_SIG_free                          2668   3_0_0   EXIST::FUNCTION:EC
 d2i_PKCS12_BAGS                         2669   3_0_0   EXIST::FUNCTION:
 RSA_public_encrypt                      2670   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,RSA
@@ -2743,7 +2743,7 @@ CMS_dataFinal                           2802      3_0_0   EXIST::FUNCTION:CMS
 ASN1_TIME_it                            2803   3_0_0   EXIST::FUNCTION:
 ENGINE_get_static_state                 2804   3_0_0   EXIST::FUNCTION:ENGINE
 EC_KEY_set_asn1_flag                    2805   3_0_0   EXIST::FUNCTION:EC
 ASN1_TIME_it                            2803   3_0_0   EXIST::FUNCTION:
 ENGINE_get_static_state                 2804   3_0_0   EXIST::FUNCTION:ENGINE
 EC_KEY_set_asn1_flag                    2805   3_0_0   EXIST::FUNCTION:EC
-EC_GFp_mont_method                      2806   3_0_0   EXIST::FUNCTION:EC
+EC_GFp_mont_method                      2806   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
 OPENSSL_asc2uni                         2807   3_0_0   EXIST::FUNCTION:
 TS_REQ_new                              2808   3_0_0   EXIST::FUNCTION:TS
 ENGINE_register_all_DH                  2809   3_0_0   EXIST::FUNCTION:ENGINE
 OPENSSL_asc2uni                         2807   3_0_0   EXIST::FUNCTION:
 TS_REQ_new                              2808   3_0_0   EXIST::FUNCTION:TS
 ENGINE_register_all_DH                  2809   3_0_0   EXIST::FUNCTION:ENGINE
@@ -2760,7 +2760,7 @@ CRYPTO_secure_used                      2819      3_0_0   EXIST::FUNCTION:
 d2i_X509_CRL_INFO                       2820   3_0_0   EXIST::FUNCTION:
 X509_CRL_get_issuer                     2821   3_0_0   EXIST::FUNCTION:
 d2i_SCT_LIST                            2822   3_0_0   EXIST::FUNCTION:CT
 d2i_X509_CRL_INFO                       2820   3_0_0   EXIST::FUNCTION:
 X509_CRL_get_issuer                     2821   3_0_0   EXIST::FUNCTION:
 d2i_SCT_LIST                            2822   3_0_0   EXIST::FUNCTION:CT
-EC_GFp_nist_method                      2823   3_0_0   EXIST::FUNCTION:EC
+EC_GFp_nist_method                      2823   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
 SCT_free                                2824   3_0_0   EXIST::FUNCTION:CT
 TS_TST_INFO_get_msg_imprint             2825   3_0_0   EXIST::FUNCTION:TS
 X509v3_addr_add_range                   2826   3_0_0   EXIST::FUNCTION:RFC3779
 SCT_free                                2824   3_0_0   EXIST::FUNCTION:CT
 TS_TST_INFO_get_msg_imprint             2825   3_0_0   EXIST::FUNCTION:TS
 X509v3_addr_add_range                   2826   3_0_0   EXIST::FUNCTION:RFC3779
@@ -2800,7 +2800,7 @@ X509_EXTENSION_dup                      2861      3_0_0   EXIST::FUNCTION:
 EVP_PKEY_asn1_new                       2862   3_0_0   EXIST::FUNCTION:
 BIO_socket_nbio                         2863   3_0_0   EXIST::FUNCTION:SOCK
 EVP_CIPHER_set_asn1_iv                  2864   3_0_0   EXIST::FUNCTION:
 EVP_PKEY_asn1_new                       2862   3_0_0   EXIST::FUNCTION:
 BIO_socket_nbio                         2863   3_0_0   EXIST::FUNCTION:SOCK
 EVP_CIPHER_set_asn1_iv                  2864   3_0_0   EXIST::FUNCTION:
-EC_GFp_nistp224_method                  2865   3_0_0   EXIST::FUNCTION:EC,EC_NISTP_64_GCC_128
+EC_GFp_nistp224_method                  2865   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC_NISTP_64_GCC_128
 BN_swap                                 2866   3_0_0   EXIST::FUNCTION:
 d2i_ECParameters                        2867   3_0_0   EXIST::FUNCTION:EC
 X509_NAME_add_entry_by_OBJ              2868   3_0_0   EXIST::FUNCTION:
 BN_swap                                 2866   3_0_0   EXIST::FUNCTION:
 d2i_ECParameters                        2867   3_0_0   EXIST::FUNCTION:EC
 X509_NAME_add_entry_by_OBJ              2868   3_0_0   EXIST::FUNCTION:
@@ -3013,7 +3013,7 @@ X509_REQ_get_X509_PUBKEY                3077      3_0_0   EXIST::FUNCTION:
 ENGINE_load_private_key                 3078   3_0_0   EXIST::FUNCTION:ENGINE
 GENERAL_NAMES_new                       3079   3_0_0   EXIST::FUNCTION:
 i2d_POLICYQUALINFO                      3080   3_0_0   EXIST::FUNCTION:
 ENGINE_load_private_key                 3078   3_0_0   EXIST::FUNCTION:ENGINE
 GENERAL_NAMES_new                       3079   3_0_0   EXIST::FUNCTION:
 i2d_POLICYQUALINFO                      3080   3_0_0   EXIST::FUNCTION:
-EC_GF2m_simple_method                   3081   3_0_0   EXIST::FUNCTION:EC,EC2M
+EC_GF2m_simple_method                   3081   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
 RSA_get_method                          3082   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,RSA
 d2i_ASRange                             3083   3_0_0   EXIST::FUNCTION:RFC3779
 CMS_ContentInfo_new                     3084   3_0_0   EXIST::FUNCTION:CMS
 RSA_get_method                          3082   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,RSA
 d2i_ASRange                             3083   3_0_0   EXIST::FUNCTION:RFC3779
 CMS_ContentInfo_new                     3084   3_0_0   EXIST::FUNCTION:CMS
@@ -3376,7 +3376,7 @@ ERR_get_next_error_library              3446      3_0_0   EXIST::FUNCTION:
 OCSP_RESPONSE_print                     3447   3_0_0   EXIST::FUNCTION:OCSP
 BN_get_rfc3526_prime_2048               3448   3_0_0   EXIST::FUNCTION:DH
 BIO_new_bio_pair                        3449   3_0_0   EXIST::FUNCTION:
 OCSP_RESPONSE_print                     3447   3_0_0   EXIST::FUNCTION:OCSP
 BN_get_rfc3526_prime_2048               3448   3_0_0   EXIST::FUNCTION:DH
 BIO_new_bio_pair                        3449   3_0_0   EXIST::FUNCTION:
-EC_GFp_nistp256_method                  3450   3_0_0   EXIST::FUNCTION:EC,EC_NISTP_64_GCC_128
+EC_GFp_nistp256_method                  3450   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC_NISTP_64_GCC_128
 BIO_method_type                         3451   3_0_0   EXIST::FUNCTION:
 ECPKParameters_print                    3452   3_0_0   EXIST::FUNCTION:EC
 EVP_rc4                                 3453   3_0_0   EXIST::FUNCTION:RC4
 BIO_method_type                         3451   3_0_0   EXIST::FUNCTION:
 ECPKParameters_print                    3452   3_0_0   EXIST::FUNCTION:EC
 EVP_rc4                                 3453   3_0_0   EXIST::FUNCTION:RC4
@@ -4683,7 +4683,6 @@ ERR_set_error                           ? 3_0_0   EXIST::FUNCTION:
 ERR_vset_error                          ?      3_0_0   EXIST::FUNCTION:
 X509_get0_authority_issuer              ?      3_0_0   EXIST::FUNCTION:
 X509_get0_authority_serial              ?      3_0_0   EXIST::FUNCTION:
 ERR_vset_error                          ?      3_0_0   EXIST::FUNCTION:
 X509_get0_authority_issuer              ?      3_0_0   EXIST::FUNCTION:
 X509_get0_authority_serial              ?      3_0_0   EXIST::FUNCTION:
-EC_GROUP_new_ex                         ?      3_0_0   EXIST::FUNCTION:EC
 EC_GROUP_new_by_curve_name_ex           ?      3_0_0   EXIST::FUNCTION:EC
 EC_KEY_new_ex                           ?      3_0_0   EXIST::FUNCTION:EC
 EC_KEY_new_by_curve_name_ex             ?      3_0_0   EXIST::FUNCTION:EC
 EC_GROUP_new_by_curve_name_ex           ?      3_0_0   EXIST::FUNCTION:EC
 EC_KEY_new_ex                           ?      3_0_0   EXIST::FUNCTION:EC
 EC_KEY_new_by_curve_name_ex             ?      3_0_0   EXIST::FUNCTION:EC
@@ -5094,6 +5093,7 @@ EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen ? 3_0_0   EXIST::FUNCTION:RSA
 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md ?      3_0_0   EXIST::FUNCTION:RSA
 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name ? 3_0_0   EXIST::FUNCTION:RSA
 OSSL_PROVIDER_do_all                    ?      3_0_0   EXIST::FUNCTION:
 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md ?      3_0_0   EXIST::FUNCTION:RSA
 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name ? 3_0_0   EXIST::FUNCTION:RSA
 OSSL_PROVIDER_do_all                    ?      3_0_0   EXIST::FUNCTION:
+EC_GROUP_get_field_type                 ?      3_0_0   EXIST::FUNCTION:EC
 X509_PUBKEY_eq                          ?      3_0_0   EXIST::FUNCTION:
 EVP_PKEY_eq                             ?      3_0_0   EXIST::FUNCTION:
 EVP_PKEY_parameters_eq                  ?      3_0_0   EXIST::FUNCTION:
 X509_PUBKEY_eq                          ?      3_0_0   EXIST::FUNCTION:
 EVP_PKEY_eq                             ?      3_0_0   EXIST::FUNCTION:
 EVP_PKEY_parameters_eq                  ?      3_0_0   EXIST::FUNCTION: