Rename implementations of method functions so that they match
authorBodo Möller <bodo@openssl.org>
Fri, 2 Aug 2002 14:28:37 +0000 (14:28 +0000)
committerBodo Möller <bodo@openssl.org>
Fri, 2 Aug 2002 14:28:37 +0000 (14:28 +0000)
the new method names where _GF... suffixes have been removed.

Revert changes to ..._{get/set}_Jprojective_coordinates_...:
The current implementation for ECC over binary fields does not use
projective coordinates, and if it did, it would not use Jacobian
projective coordinates; so it's OK to use the ..._GFp prefix for all
this.

Add author attributions to some files so that it doesn't look
as if Sun wrote all of this :-)

17 files changed:
CHANGES
crypto/bn/Makefile.ssl
crypto/ec/Makefile.ssl
crypto/ec/ec.h
crypto/ec/ec2_smpl.c
crypto/ec/ec2_smpt.c
crypto/ec/ec_cvt.c
crypto/ec/ec_err.c
crypto/ec/ec_lcl.h
crypto/ec/ec_lib.c
crypto/ec/ec_mult.c
crypto/ec/ecp_mont.c
crypto/ec/ecp_nist.c
crypto/ec/ecp_recp.c
crypto/ec/ecp_smpl.c
crypto/ec/ectest.c
test/Makefile.ssl

diff --git a/CHANGES b/CHANGES
index 680eb18978fe4c00ece13a403edae16a7518603b..1ce30313e45b200cf8627b0a42b1580eba66d053 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -21,8 +21,6 @@
           EC_GROUP_new_curve_GF2m
           EC_GROUP_set_curve_GF2m
           EC_GROUP_get_curve_GF2m
-          EC_POINT_set_Jprojective_coordinates_GF2m
-          EC_POINT_get_Jprojective_coordinates_GF2m
           EC_POINT_set_affine_coordinates_GF2m
           EC_POINT_get_affine_coordinates_GF2m
           EC_POINT_set_compressed_coordinates_GF2m
index c8bfa7fdf44fd90e34f88a83f3c0f14251803923..4e27e87eabfc1c1a044ffa687b50ab7bb95bc0cb 100644 (file)
@@ -194,13 +194,6 @@ bn_asm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 bn_asm.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
 bn_asm.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 bn_asm.o: ../cryptlib.h bn_asm.c bn_lcl.h
-bn_gf2m.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
-bn_gf2m.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
-bn_gf2m.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
-bn_gf2m.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
-bn_gf2m.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
-bn_gf2m.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
-bn_gf2m.o: ../cryptlib.h bn_gf2m.c bn_lcl.h
 bn_blind.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
 bn_blind.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 bn_blind.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
@@ -249,6 +242,13 @@ bn_gcd.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 bn_gcd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
 bn_gcd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 bn_gcd.o: ../cryptlib.h bn_gcd.c bn_lcl.h
+bn_gf2m.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
+bn_gf2m.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
+bn_gf2m.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
+bn_gf2m.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
+bn_gf2m.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
+bn_gf2m.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+bn_gf2m.o: ../cryptlib.h bn_gf2m.c bn_lcl.h
 bn_kron.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h
 bn_kron.o: ../../include/openssl/opensslconf.h bn_kron.c bn_lcl.h
 bn_lib.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
index 67917ffbf3d738af96ded14c97bcfaef7ce25795..fbc80ff05e3da130a85168d76d5bee2a12e09abe 100644 (file)
@@ -84,6 +84,23 @@ clean:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
+ec2_mult.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
+ec2_mult.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
+ec2_mult.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
+ec2_mult.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
+ec2_mult.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
+ec2_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+ec2_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
+ec2_mult.o: ../../include/openssl/symhacks.h ec2_mult.c ec_lcl.h
+ec2_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
+ec2_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
+ec2_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
+ec2_smpl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
+ec2_smpl.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
+ec2_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+ec2_smpl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
+ec2_smpl.o: ../../include/openssl/symhacks.h ec2_smpl.c ec2_smpt.c ec_lcl.h
+ec2_smpt.o: ec2_smpt.c
 ec_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
 ec_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 ec_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
@@ -178,17 +195,3 @@ ecp_smpl.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
 ecp_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 ecp_smpl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 ecp_smpl.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_smpl.c
-ec2_smpl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
-ec2_smpl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
-ec2_smpl.o: ../../include/openssl/ec.h ../../include/openssl/err.h
-ec2_smpl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
-ec2_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
-ec2_smpl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
-ec2_smpl.o: ec_lcl.h ec2_smpl.c ec2_smpt.c
-ec2_mult.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
-ec2_mult.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
-ec2_mult.o: ../../include/openssl/ec.h ../../include/openssl/err.h
-ec2_mult.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
-ec2_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
-ec2_mult.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
-ec2_mult.o: ec_lcl.h ec2_mult.c
index f34ce16c38311362cafc2ee76fa6bfe5561ad73f..ff9af9f8e4d3cfe3adce1eba797d9e9e9a137630 100644 (file)
@@ -1,4 +1,7 @@
 /* crypto/ec/ec.h */
+/*
+ * Originally written by Bodo Moeller for the OpenSSL project.
+ */
 /* ====================================================================
  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
  *
@@ -288,10 +291,6 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *, const EC_POINT *,
 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *, EC_POINT *,
        const BIGNUM *x, int y_bit, BN_CTX *);
 
-int EC_POINT_set_Jprojective_coordinates_GF2m(const EC_GROUP *, EC_POINT *,
-       const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *);
-int EC_POINT_get_Jprojective_coordinates_GF2m(const EC_GROUP *, const EC_POINT *,
-       BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *);
 int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *, EC_POINT *,
        const BIGNUM *x, const BIGNUM *y, BN_CTX *);
 int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *, const EC_POINT *,
@@ -406,23 +405,23 @@ void ERR_load_EC_strings(void);
 #define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT    168
 #define EC_F_EC_GF2M_SIMPLE_OCT2POINT                   169
 #define EC_F_EC_GF2M_SIMPLE_POINT2OCT                   170
-#define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES_GF2M 171
-#define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES_GF2M 172
-#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES_GF2M 185
+#define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 171
+#define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 172
+#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES  182
 #define EC_F_EC_GFP_MONT_FIELD_DECODE                   133
 #define EC_F_EC_GFP_MONT_FIELD_ENCODE                   134
 #define EC_F_EC_GFP_MONT_FIELD_MUL                      131
 #define EC_F_EC_GFP_MONT_FIELD_SQR                      132
 #define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT     152
-#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP          100
+#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE              100
 #define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR          101
 #define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE                  102
 #define EC_F_EC_GFP_SIMPLE_OCT2POINT                    103
 #define EC_F_EC_GFP_SIMPLE_POINT2OCT                    104
 #define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE           137
-#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105
-#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128
-#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129
+#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 105
+#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 128
+#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 129
 #define EC_F_EC_GROUP_CHECK                             150
 #define EC_F_EC_GROUP_CHECK_DISCRIMINANT                153
 #define EC_F_EC_GROUP_COPY                              106
@@ -452,7 +451,6 @@ void ERR_load_EC_strings(void);
 #define EC_F_EC_POINT_DBL                               115
 #define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M       177
 #define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP        116
-#define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GF2M  178
 #define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP   117
 #define EC_F_EC_POINT_IS_AT_INFINITY                    118
 #define EC_F_EC_POINT_IS_ON_CURVE                       119
@@ -465,12 +463,11 @@ void ERR_load_EC_strings(void);
 #define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP        124
 #define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M   181
 #define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP    125
-#define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GF2M  182
 #define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP   126
 #define EC_F_EC_POINT_SET_TO_INFINITY                   127
 #define EC_F_EC_WNAF_MUL                                183
-#define EC_F_EC_WNAF_PRECOMPUTE_MULT                    184
-#define EC_F_GFP_MONT_GROUP_SET_CURVE_GFP               135
+#define EC_F_EC_WNAF_PRECOMPUTE_MULT                    178
+#define EC_F_GFP_MONT_GROUP_SET_CURVE                   135
 #define EC_F_I2D_ECDSAPARAMETERS                        158
 #define EC_F_I2D_ECPARAMETERS                           164
 #define EC_F_I2D_ECPKPARAMETERS                                 165
index 09ce5393348bc03509cdf0275c81ae3a9eaacb9b..980d396c81284003c0de58e58f2db8fbd41d9d01 100644 (file)
@@ -93,8 +93,8 @@ const EC_METHOD *EC_GF2m_simple_method(void)
                ec_GF2m_simple_group_finish,
                ec_GF2m_simple_group_clear_finish,
                ec_GF2m_simple_group_copy,
-               ec_GF2m_simple_group_set_curve_GF2m,
-               ec_GF2m_simple_group_get_curve_GF2m,
+               ec_GF2m_simple_group_set_curve,
+               ec_GF2m_simple_group_get_curve,
                ec_GF2m_simple_group_get_degree,
                ec_GF2m_simple_group_check_discriminant,
                ec_GF2m_simple_point_init,
@@ -102,11 +102,11 @@ const EC_METHOD *EC_GF2m_simple_method(void)
                ec_GF2m_simple_point_clear_finish,
                ec_GF2m_simple_point_copy,
                ec_GF2m_simple_point_set_to_infinity,
-               0 /* set_Jprojective_coordinates_GF2m */,
-               0 /* get_Jprojective_coordinates_GF2m */,
-               ec_GF2m_simple_point_set_affine_coordinates_GF2m,
-               ec_GF2m_simple_point_get_affine_coordinates_GF2m,
-               ec_GF2m_simple_set_compressed_coordinates_GF2m,
+               0 /* set_Jprojective_coordinates_GFp */,
+               0 /* get_Jprojective_coordinates_GFp */,
+               ec_GF2m_simple_point_set_affine_coordinates,
+               ec_GF2m_simple_point_get_affine_coordinates,
+               ec_GF2m_simple_set_compressed_coordinates,
                ec_GF2m_simple_point2oct,
                ec_GF2m_simple_oct2point,
                ec_GF2m_simple_add,
@@ -192,7 +192,7 @@ int ec_GF2m_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
 
 
 /* Set the curve parameters of an EC_GROUP structure. */
-int ec_GF2m_simple_group_set_curve_GF2m(EC_GROUP *group,
+int ec_GF2m_simple_group_set_curve(EC_GROUP *group,
        const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
        {
        int ret = 0, i;
@@ -221,7 +221,7 @@ int ec_GF2m_simple_group_set_curve_GF2m(EC_GROUP *group,
 /* Get the curve parameters of an EC_GROUP structure.
  * If p, a, or b are NULL then there values will not be set but the method will return with success.
  */
-int ec_GF2m_simple_group_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
+int ec_GF2m_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
        {
        int ret = 0;
        
@@ -349,13 +349,13 @@ int ec_GF2m_simple_point_set_to_infinity(const EC_GROUP *group, EC_POINT *point)
 /* Set the coordinates of an EC_POINT using affine coordinates. 
  * Note that the simple implementation only uses affine coordinates.
  */
-int ec_GF2m_simple_point_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *point,
+int ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group, EC_POINT *point,
        const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)
        {
        int ret = 0;    
        if (x == NULL || y == NULL)
                {
-               ECerr(EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES_GF2M, ERR_R_PASSED_NULL_PARAMETER);
+               ECerr(EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES, ERR_R_PASSED_NULL_PARAMETER);
                return 0;
                }
 
@@ -373,20 +373,20 @@ int ec_GF2m_simple_point_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_P
 /* Gets the affine coordinates of an EC_POINT. 
  * Note that the simple implementation only uses affine coordinates.
  */
-int ec_GF2m_simple_point_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *point,
+int ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point,
        BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
        {
        int ret = 0;
 
        if (EC_POINT_is_at_infinity(group, point))
                {
-               ECerr(EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES_GF2M, EC_R_POINT_AT_INFINITY);
+               ECerr(EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES, EC_R_POINT_AT_INFINITY);
                return 0;
                }
 
        if (BN_cmp(&point->Z, BN_value_one())) 
                {
-               ECerr(EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES_GF2M, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+               ECerr(EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                return 0;
                }
        if (x != NULL)
index d569c22ae09b45315475a3b9aa3e5df9237514b8..1b014e5d96814ee7819350f2811b88c8357b1c42 100644 (file)
  * This function is disabled by default and can be enabled by defining the 
  * preprocessor macro OPENSSL_EC_BIN_PT_COMP at Configure-time.
  */
-int ec_GF2m_simple_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *point,
+int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point,
        const BIGNUM *x_, int y_bit, BN_CTX *ctx)
        {
 #ifndef OPENSSL_EC_BIN_PT_COMP 
-       ECerr(EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES_GF2M, ERR_R_DISABLED);
+       ECerr(EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES, ERR_R_DISABLED);
        return 0;
 #else
        BN_CTX *new_ctx = NULL;
index 01453a283c711e88c92c2e14edaed455d577383b..22789a57e5cc46439e9a7f361636614639923f51 100644 (file)
@@ -1,4 +1,7 @@
 /* crypto/ec/ec_cvt.c */
+/*
+ * Originally written by Bodo Moeller for the OpenSSL project.
+ */
 /* ====================================================================
  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
  *
index 0bc0bfb1bde072023c8fcb11fe1e2a0ab18d02b7..c5ff12b3666e7972c2600fc4c75bf10268fbe86f 100644 (file)
@@ -81,23 +81,23 @@ static ERR_STRING_DATA EC_str_functs[]=
 {ERR_PACK(0,EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT,0),   "ec_GF2m_simple_group_check_discriminant"},
 {ERR_PACK(0,EC_F_EC_GF2M_SIMPLE_OCT2POINT,0),  "ec_GF2m_simple_oct2point"},
 {ERR_PACK(0,EC_F_EC_GF2M_SIMPLE_POINT2OCT,0),  "ec_GF2m_simple_point2oct"},
-{ERR_PACK(0,EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES_GF2M,0),  "ec_GF2m_simple_point_get_affine_coordinates_GF2m"},
-{ERR_PACK(0,EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES_GF2M,0),  "ec_GF2m_simple_point_set_affine_coordinates_GF2m"},
-{ERR_PACK(0,EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES_GF2M,0),    "ec_GF2m_simple_set_compressed_coordinates_GF2m"},
+{ERR_PACK(0,EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES,0),       "ec_GF2m_simple_point_get_affine_coordinates"},
+{ERR_PACK(0,EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES,0),       "ec_GF2m_simple_point_set_affine_coordinates"},
+{ERR_PACK(0,EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES,0), "ec_GF2m_simple_set_compressed_coordinates"},
 {ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_DECODE,0),  "ec_GFp_mont_field_decode"},
 {ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_ENCODE,0),  "ec_GFp_mont_field_encode"},
 {ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_MUL,0),     "ec_GFp_mont_field_mul"},
 {ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_SQR,0),     "ec_GFp_mont_field_sqr"},
 {ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT,0),    "ec_GFp_simple_group_check_discriminant"},
-{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP,0), "ec_GFp_simple_group_set_curve_GFp"},
+{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE,0),     "ec_GFp_simple_group_set_curve"},
 {ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR,0), "EC_GFP_SIMPLE_GROUP_SET_GENERATOR"},
 {ERR_PACK(0,EC_F_EC_GFP_SIMPLE_MAKE_AFFINE,0), "ec_GFp_simple_make_affine"},
 {ERR_PACK(0,EC_F_EC_GFP_SIMPLE_OCT2POINT,0),   "ec_GFp_simple_oct2point"},
 {ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT2OCT,0),   "ec_GFp_simple_point2oct"},
 {ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE,0),  "ec_GFp_simple_points_make_affine"},
-{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP,0),    "ec_GFp_simple_point_get_affine_coordinates_GFp"},
-{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP,0),    "ec_GFp_simple_point_set_affine_coordinates_GFp"},
-{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP,0),      "ec_GFp_simple_set_compressed_coordinates_GFp"},
+{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES,0),        "ec_GFp_simple_point_get_affine_coordinates"},
+{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES,0),        "ec_GFp_simple_point_set_affine_coordinates"},
+{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES,0),  "ec_GFp_simple_set_compressed_coordinates"},
 {ERR_PACK(0,EC_F_EC_GROUP_CHECK,0),    "EC_GROUP_check"},
 {ERR_PACK(0,EC_F_EC_GROUP_CHECK_DISCRIMINANT,0),       "EC_GROUP_check_discriminant"},
 {ERR_PACK(0,EC_F_EC_GROUP_COPY,0),     "EC_GROUP_copy"},
@@ -125,9 +125,7 @@ static ERR_STRING_DATA EC_str_functs[]=
 {ERR_PACK(0,EC_F_EC_POINT_CMP,0),      "EC_POINT_cmp"},
 {ERR_PACK(0,EC_F_EC_POINT_COPY,0),     "EC_POINT_copy"},
 {ERR_PACK(0,EC_F_EC_POINT_DBL,0),      "EC_POINT_dbl"},
-{ERR_PACK(0,EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M,0),      "EC_POINT_get_affine_coordinates_GF2m"},
 {ERR_PACK(0,EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP,0),       "EC_POINT_get_affine_coordinates_GFp"},
-{ERR_PACK(0,EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GF2M,0), "EC_POINT_get_Jprojective_coordinates_GF2m"},
 {ERR_PACK(0,EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP,0),  "EC_POINT_get_Jprojective_coordinates_GFp"},
 {ERR_PACK(0,EC_F_EC_POINT_IS_AT_INFINITY,0),   "EC_POINT_is_at_infinity"},
 {ERR_PACK(0,EC_F_EC_POINT_IS_ON_CURVE,0),      "EC_POINT_is_on_curve"},
@@ -140,12 +138,11 @@ static ERR_STRING_DATA EC_str_functs[]=
 {ERR_PACK(0,EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP,0),       "EC_POINT_set_affine_coordinates_GFp"},
 {ERR_PACK(0,EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M,0),  "EC_POINT_set_compressed_coordinates_GF2m"},
 {ERR_PACK(0,EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP,0),   "EC_POINT_set_compressed_coordinates_GFp"},
-{ERR_PACK(0,EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GF2M,0), "EC_POINT_set_Jprojective_coordinates_GF2m"},
 {ERR_PACK(0,EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP,0),  "EC_POINT_set_Jprojective_coordinates_GFp"},
 {ERR_PACK(0,EC_F_EC_POINT_SET_TO_INFINITY,0),  "EC_POINT_set_to_infinity"},
 {ERR_PACK(0,EC_F_EC_WNAF_MUL,0),       "ec_wNAF_mul"},
 {ERR_PACK(0,EC_F_EC_WNAF_PRECOMPUTE_MULT,0),   "ec_wNAF_precompute_mult"},
-{ERR_PACK(0,EC_F_GFP_MONT_GROUP_SET_CURVE_GFP,0),      "GFP_MONT_GROUP_SET_CURVE_GFP"},
+{ERR_PACK(0,EC_F_GFP_MONT_GROUP_SET_CURVE,0),  "GFP_MONT_GROUP_SET_CURVE"},
 {ERR_PACK(0,EC_F_I2D_ECDSAPARAMETERS,0),       "i2d_ECDSAParameters"},
 {ERR_PACK(0,EC_F_I2D_ECPARAMETERS,0),  "i2d_ECParameters"},
 {ERR_PACK(0,EC_F_I2D_ECPKPARAMETERS,0),        "i2d_ECPKParameters"},
index bd83779bf1c529c11e5cfda5965560531cfef1bc..5730f2ab961bfe90b64f5b3e2d110d94c758855f 100644 (file)
@@ -1,4 +1,7 @@
 /* crypto/ec/ec_lcl.h */
+/*
+ * Originally written by Bodo Moeller for the OpenSSL project.
+ */
 /* ====================================================================
  * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
  *
@@ -117,16 +120,16 @@ struct ec_method_st {
        int (*point_copy)(EC_POINT *, const EC_POINT *);
 
        /* used by EC_POINT_set_to_infinity,
-        * 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_compressed_coordinates_GFp, EC_POINT_set_Jprojective_coordinates_GF2m, 
-        * EC_POINT_get_Jprojective_coordinates_GF2m, EC_POINT_set_affine_coordinates_GF2m, 
-        * EC_POINT_get_affine_coordinates_GF2m, and EC_POINT_set_compressed_coordinates_GF2m:
+        * EC_POINT_set_Jprojective_coordinates_GFp,
+        * EC_POINT_get_Jprojective_coordinates_GFp,
+        * EC_POINT_set_affine_coordinates_GFp,     ..._GF2m,
+        * EC_POINT_get_affine_coordinates_GFp,     ..._GF2m,
+        * EC_POINT_set_compressed_coordinates_GFp, ..._GF2m:
         */
        int (*point_set_to_infinity)(const EC_GROUP *, EC_POINT *);
-       int (*point_set_Jprojective_coordinates)(const EC_GROUP *, EC_POINT *,
+       int (*point_set_Jprojective_coordinates_GFp)(const EC_GROUP *, EC_POINT *,
                const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *);
-       int (*point_get_Jprojective_coordinates)(const EC_GROUP *, const EC_POINT *,
+       int (*point_get_Jprojective_coordinates_GFp)(const EC_GROUP *, const EC_POINT *,
                BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *);
        int (*point_set_affine_coordinates)(const EC_GROUP *, EC_POINT *,
                const BIGNUM *x, const BIGNUM *y, BN_CTX *);
@@ -267,8 +270,8 @@ int ec_GFp_simple_group_init(EC_GROUP *);
 void ec_GFp_simple_group_finish(EC_GROUP *);
 void ec_GFp_simple_group_clear_finish(EC_GROUP *);
 int ec_GFp_simple_group_copy(EC_GROUP *, const EC_GROUP *);
-int ec_GFp_simple_group_set_curve_GFp(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
-int ec_GFp_simple_group_get_curve_GFp(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *);
+int ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
+int ec_GFp_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *);
 int ec_GFp_simple_group_get_degree(const EC_GROUP *);
 int ec_GFp_simple_group_check_discriminant(const EC_GROUP *, BN_CTX *);
 int ec_GFp_simple_point_init(EC_POINT *);
@@ -280,11 +283,11 @@ int ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP *, EC_POINT *,
        const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *);
 int ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP *, const EC_POINT *,
        BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *);
-int ec_GFp_simple_point_set_affine_coordinates_GFp(const EC_GROUP *, EC_POINT *,
+int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *, EC_POINT *,
        const BIGNUM *x, const BIGNUM *y, BN_CTX *);
-int ec_GFp_simple_point_get_affine_coordinates_GFp(const EC_GROUP *, const EC_POINT *,
+int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *, const EC_POINT *,
        BIGNUM *x, BIGNUM *y, BN_CTX *);
-int ec_GFp_simple_set_compressed_coordinates_GFp(const EC_GROUP *, EC_POINT *,
+int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *, EC_POINT *,
        const BIGNUM *x, int y_bit, BN_CTX *);
 size_t ec_GFp_simple_point2oct(const EC_GROUP *, const EC_POINT *, point_conversion_form_t form,
        unsigned char *buf, size_t len, BN_CTX *);
@@ -304,7 +307,7 @@ int ec_GFp_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX
 
 /* method functions in ecp_mont.c */
 int ec_GFp_mont_group_init(EC_GROUP *);
-int ec_GFp_mont_group_set_curve_GFp(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
+int ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 void ec_GFp_mont_group_finish(EC_GROUP *);
 void ec_GFp_mont_group_clear_finish(EC_GROUP *);
 int ec_GFp_mont_group_copy(EC_GROUP *, const EC_GROUP *);
@@ -317,7 +320,7 @@ int ec_GFp_mont_field_set_to_one(const EC_GROUP *, BIGNUM *r, BN_CTX *);
 
 /* method functions in ecp_recp.c */
 int ec_GFp_recp_group_init(EC_GROUP *);
-int ec_GFp_recp_group_set_curve_GFp(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
+int ec_GFp_recp_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 void ec_GFp_recp_group_finish(EC_GROUP *);
 void ec_GFp_recp_group_clear_finish(EC_GROUP *);
 int ec_GFp_recp_group_copy(EC_GROUP *, const EC_GROUP *);
@@ -327,7 +330,7 @@ int ec_GFp_recp_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *
 
 /* method functions in ecp_nist.c */
 int ec_GFp_nist_group_init(EC_GROUP *);
-int ec_GFp_nist_group_set_curve_GFp(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
+int ec_GFp_nist_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 void ec_GFp_nist_group_finish(EC_GROUP *);
 void ec_GFp_nist_group_clear_finish(EC_GROUP *);
 int ec_GFp_nist_group_copy(EC_GROUP *, const EC_GROUP *);
@@ -340,8 +343,8 @@ int ec_GF2m_simple_group_init(EC_GROUP *);
 void ec_GF2m_simple_group_finish(EC_GROUP *);
 void ec_GF2m_simple_group_clear_finish(EC_GROUP *);
 int ec_GF2m_simple_group_copy(EC_GROUP *, const EC_GROUP *);
-int ec_GF2m_simple_group_set_curve_GF2m(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
-int ec_GF2m_simple_group_get_curve_GF2m(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *);
+int ec_GF2m_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
+int ec_GF2m_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *);
 int ec_GF2m_simple_group_get_degree(const EC_GROUP *);
 int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *, BN_CTX *);
 int ec_GF2m_simple_point_init(EC_POINT *);
@@ -349,11 +352,11 @@ void ec_GF2m_simple_point_finish(EC_POINT *);
 void ec_GF2m_simple_point_clear_finish(EC_POINT *);
 int ec_GF2m_simple_point_copy(EC_POINT *, const EC_POINT *);
 int ec_GF2m_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *);
-int ec_GF2m_simple_point_set_affine_coordinates_GF2m(const EC_GROUP *, EC_POINT *,
+int ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *, EC_POINT *,
        const BIGNUM *x, const BIGNUM *y, BN_CTX *);
-int ec_GF2m_simple_point_get_affine_coordinates_GF2m(const EC_GROUP *, const EC_POINT *,
+int ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *, const EC_POINT *,
        BIGNUM *x, BIGNUM *y, BN_CTX *);
-int ec_GF2m_simple_set_compressed_coordinates_GF2m(const EC_GROUP *, EC_POINT *,
+int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *, EC_POINT *,
        const BIGNUM *x, int y_bit, BN_CTX *);
 size_t ec_GF2m_simple_point2oct(const EC_GROUP *, const EC_POINT *, point_conversion_form_t form,
        unsigned char *buf, size_t len, BN_CTX *);
index 53da1d305758a291f903dff04b771127315dea5e..9669f42aab94ebe10791c773236a1b209fc05d3f 100644 (file)
@@ -1,4 +1,7 @@
 /* crypto/ec/ec_lib.c */
+/*
+ * Originally written by Bodo Moeller for the OpenSSL project.
+ */
 /* ====================================================================
  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
  *
@@ -655,7 +658,7 @@ int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point)
 int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *point,
        const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx)
        {
-       if (group->meth->point_set_Jprojective_coordinates == 0)
+       if (group->meth->point_set_Jprojective_coordinates_GFp == 0)
                {
                ECerr(EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                return 0;
@@ -665,14 +668,14 @@ int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *po
                ECerr(EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS);
                return 0;
                }
-       return group->meth->point_set_Jprojective_coordinates(group, point, x, y, z, ctx);
+       return group->meth->point_set_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
        }
 
 
 int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, const EC_POINT *point,
        BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx)
        {
-       if (group->meth->point_get_Jprojective_coordinates == 0)
+       if (group->meth->point_get_Jprojective_coordinates_GFp == 0)
                {
                ECerr(EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                return 0;
@@ -682,7 +685,7 @@ int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, const EC_POI
                ECerr(EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS);
                return 0;
                }
-       return group->meth->point_get_Jprojective_coordinates(group, point, x, y, z, ctx);
+       return group->meth->point_get_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
        }
 
 
@@ -703,105 +706,71 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point,
        }
 
 
-int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *point,
-       BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
-       {
-       if (group->meth->point_get_affine_coordinates == 0)
-               {
-               ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
-               return 0;
-               }
-       if (group->meth != point->meth)
-               {
-               ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS);
-               return 0;
-               }
-       return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
-       }
-
-
-int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *point,
-       const BIGNUM *x, int y_bit, BN_CTX *ctx)
-       {
-       if (group->meth->point_set_compressed_coordinates == 0)
-               {
-               ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
-               return 0;
-               }
-       if (group->meth != point->meth)
-               {
-               ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS);
-               return 0;
-               }
-       return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, ctx);
-       }
-
-
-int EC_POINT_set_Jprojective_coordinates_GF2m(const EC_GROUP *group, EC_POINT *point,
-       const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx)
+int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *point,
+       const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)
        {
-       if (group->meth->point_set_Jprojective_coordinates == 0)
+       if (group->meth->point_set_affine_coordinates == 0)
                {
-               ECerr(EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GF2M, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+               ECerr(EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                return 0;
                }
        if (group->meth != point->meth)
                {
-               ECerr(EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS);
+               ECerr(EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS);
                return 0;
                }
-       return group->meth->point_set_Jprojective_coordinates(group, point, x, y, z, ctx);
+       return group->meth->point_set_affine_coordinates(group, point, x, y, ctx);
        }
 
 
-int EC_POINT_get_Jprojective_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *point,
-       BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx)
+int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *point,
+       BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
        {
-       if (group->meth->point_get_Jprojective_coordinates == 0)
+       if (group->meth->point_get_affine_coordinates == 0)
                {
-               ECerr(EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GF2M, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+               ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                return 0;
                }
        if (group->meth != point->meth)
                {
-               ECerr(EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS);
+               ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS);
                return 0;
                }
-       return group->meth->point_get_Jprojective_coordinates(group, point, x, y, z, ctx);
+       return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
        }
 
 
-int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *point,
-       const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)
+int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *point,
+       BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
        {
-       if (group->meth->point_set_affine_coordinates == 0)
+       if (group->meth->point_get_affine_coordinates == 0)
                {
-               ECerr(EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+               ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                return 0;
                }
        if (group->meth != point->meth)
                {
-               ECerr(EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS);
+               ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS);
                return 0;
                }
-       return group->meth->point_set_affine_coordinates(group, point, x, y, ctx);
+       return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
        }
 
 
-int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *point,
-       BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
+int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *point,
+       const BIGNUM *x, int y_bit, BN_CTX *ctx)
        {
-       if (group->meth->point_get_affine_coordinates == 0)
+       if (group->meth->point_set_compressed_coordinates == 0)
                {
-               ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+               ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                return 0;
                }
        if (group->meth != point->meth)
                {
-               ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS);
+               ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS);
                return 0;
                }
-       return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
+       return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, ctx);
        }
 
 
index 3055b05d572019c18c98a5d73323c057bc1500bc..4978a54352ba5b8d828af9437a311cfda20a37b4 100644 (file)
@@ -1,4 +1,7 @@
 /* crypto/ec/ec_mult.c */
+/*
+ * Originally written by Bodo Moeller for the OpenSSL project.
+ */
 /* ====================================================================
  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
  *
index 21592d007af17e42fd51e2ceaf31ee9a0a11bcdb..900228d8af30306f5cdd3cc873c0b6a7bf795a96 100644 (file)
@@ -1,4 +1,7 @@
 /* crypto/ec/ecp_mont.c */
+/*
+ * Originally written by Bodo Moeller for the OpenSSL project.
+ */
 /* ====================================================================
  * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
  *
@@ -71,8 +74,8 @@ const EC_METHOD *EC_GFp_mont_method(void)
                ec_GFp_mont_group_finish,
                ec_GFp_mont_group_clear_finish,
                ec_GFp_mont_group_copy,
-               ec_GFp_mont_group_set_curve_GFp,
-               ec_GFp_simple_group_get_curve_GFp,
+               ec_GFp_mont_group_set_curve,
+               ec_GFp_simple_group_get_curve,
                ec_GFp_simple_group_get_degree,
                ec_GFp_simple_group_check_discriminant,
                ec_GFp_simple_point_init,
@@ -82,9 +85,9 @@ const EC_METHOD *EC_GFp_mont_method(void)
                ec_GFp_simple_point_set_to_infinity,
                ec_GFp_simple_set_Jprojective_coordinates_GFp,
                ec_GFp_simple_get_Jprojective_coordinates_GFp,
-               ec_GFp_simple_point_set_affine_coordinates_GFp,
-               ec_GFp_simple_point_get_affine_coordinates_GFp,
-               ec_GFp_simple_set_compressed_coordinates_GFp,
+               ec_GFp_simple_point_set_affine_coordinates,
+               ec_GFp_simple_point_get_affine_coordinates,
+               ec_GFp_simple_set_compressed_coordinates,
                ec_GFp_simple_point2oct,
                ec_GFp_simple_oct2point,
                ec_GFp_simple_add,
@@ -119,7 +122,7 @@ int ec_GFp_mont_group_init(EC_GROUP *group)
        }
 
 
-int ec_GFp_mont_group_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
+int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
        {
        BN_CTX *new_ctx = NULL;
        BN_MONT_CTX *mont = NULL;
@@ -148,7 +151,7 @@ int ec_GFp_mont_group_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGN
        if (mont == NULL) goto err;
        if (!BN_MONT_CTX_set(mont, p, ctx))
                {
-               ECerr(EC_F_GFP_MONT_GROUP_SET_CURVE_GFP, ERR_R_BN_LIB);
+               ECerr(EC_F_GFP_MONT_GROUP_SET_CURVE, ERR_R_BN_LIB);
                goto err;
                }
        one = BN_new();
@@ -160,7 +163,7 @@ int ec_GFp_mont_group_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGN
        group->field_data2 = one;
        one = NULL;
 
-       ret = ec_GFp_simple_group_set_curve_GFp(group, p, a, b, ctx);
+       ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 
        if (!ret)
                {
index d7488e75c6c6d0f07bdf4a444ddc7bef9e0fffc3..b1c4024c2a7ec83fbc738440bf375b47f02a8319 100644 (file)
@@ -68,8 +68,8 @@ const EC_METHOD *EC_GFp_nist_method(void)
                ec_GFp_nist_group_finish,
                ec_GFp_nist_group_clear_finish,
                ec_GFp_nist_group_copy,
-               ec_GFp_nist_group_set_curve_GFp,
-               ec_GFp_simple_group_get_curve_GFp,
+               ec_GFp_nist_group_set_curve,
+               ec_GFp_simple_group_get_curve,
                ec_GFp_simple_group_get_degree,
                ec_GFp_simple_group_set_generator,
                ec_GFp_simple_group_get0_generator,
@@ -83,9 +83,9 @@ const EC_METHOD *EC_GFp_nist_method(void)
                ec_GFp_simple_point_set_to_infinity,
                ec_GFp_simple_set_Jprojective_coordinates_GFp,
                ec_GFp_simple_get_Jprojective_coordinates_GFp,
-               ec_GFp_simple_point_set_affine_coordinates_GFp,
-               ec_GFp_simple_point_get_affine_coordinates_GFp,
-               ec_GFp_simple_set_compressed_coordinates_GFp,
+               ec_GFp_simple_point_set_affine_coordinates,
+               ec_GFp_simple_point_get_affine_coordinates,
+               ec_GFp_simple_set_compressed_coordinates,
                ec_GFp_simple_point2oct,
                ec_GFp_simple_oct2point,
                ec_GFp_simple_add,
@@ -120,7 +120,7 @@ int ec_GFp_nist_group_init(EC_GROUP *group)
        }
 
 
-int ec_GFp_nist_group_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+int ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
 /* TODO */
 
 
index f26b571d3d8255332b9320f8ffba8e64d9914f71..bf456dbc47242b11ca9c05460f81c33bb6bb5860 100644 (file)
@@ -68,8 +68,8 @@ const EC_METHOD *EC_GFp_recp_method(void)
                ec_GFp_recp_group_finish,
                ec_GFp_recp_group_clear_finish,
                ec_GFp_recp_group_copy,
-               ec_GFp_recp_group_set_curve_GFp,
-               ec_GFp_simple_group_get_curve_GFp,
+               ec_GFp_recp_group_set_curve,
+               ec_GFp_simple_group_get_curve,
                ec_GFp_simple_group_get_degree,
                ec_GFp_simple_group_set_generator,
                ec_GFp_simple_group_get0_generator,
@@ -83,9 +83,9 @@ const EC_METHOD *EC_GFp_recp_method(void)
                ec_GFp_simple_point_set_to_infinity,
                ec_GFp_simple_set_Jprojective_coordinates_GFp,
                ec_GFp_simple_get_Jprojective_coordinates_GFp,
-               ec_GFp_simple_point_set_affine_coordinates_GFp,
-               ec_GFp_simple_point_get_affine_coordinates_GFp,
-               ec_GFp_simple_set_compressed_coordinates_GFp,
+               ec_GFp_simple_point_set_affine_coordinates,
+               ec_GFp_simple_point_get_affine_coordinates,
+               ec_GFp_simple_set_compressed_coordinates,
                ec_GFp_simple_point2oct,
                ec_GFp_simple_oct2point,
                ec_GFp_simple_add,
@@ -119,7 +119,7 @@ int ec_GFp_recp_group_init(EC_GROUP *group)
        }
 
 
-int ec_GFp_recp_group_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+int ec_GFp_recp_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
 /* TODO */
 
 
index 27b4472b71700eea505633f229797475f9907e30..70fed912a23e1a018a55425584408879cca724a0 100644 (file)
@@ -1,6 +1,8 @@
 /* crypto/ec/ecp_smpl.c */
 /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
- * for the OpenSSL project. */
+ * for the OpenSSL project. 
+ * Includes code written by Bodo Moeller for the OpenSSL project.
+*/
 /* ====================================================================
  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
  *
@@ -73,8 +75,8 @@ const EC_METHOD *EC_GFp_simple_method(void)
                ec_GFp_simple_group_finish,
                ec_GFp_simple_group_clear_finish,
                ec_GFp_simple_group_copy,
-               ec_GFp_simple_group_set_curve_GFp,
-               ec_GFp_simple_group_get_curve_GFp,
+               ec_GFp_simple_group_set_curve,
+               ec_GFp_simple_group_get_curve,
                ec_GFp_simple_group_get_degree,
                ec_GFp_simple_group_check_discriminant,
                ec_GFp_simple_point_init,
@@ -84,9 +86,9 @@ const EC_METHOD *EC_GFp_simple_method(void)
                ec_GFp_simple_point_set_to_infinity,
                ec_GFp_simple_set_Jprojective_coordinates_GFp,
                ec_GFp_simple_get_Jprojective_coordinates_GFp,
-               ec_GFp_simple_point_set_affine_coordinates_GFp,
-               ec_GFp_simple_point_get_affine_coordinates_GFp,
-               ec_GFp_simple_set_compressed_coordinates_GFp,
+               ec_GFp_simple_point_set_affine_coordinates,
+               ec_GFp_simple_point_get_affine_coordinates,
+               ec_GFp_simple_set_compressed_coordinates,
                ec_GFp_simple_point2oct,
                ec_GFp_simple_oct2point,
                ec_GFp_simple_add,
@@ -148,7 +150,7 @@ int ec_GFp_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
        }
 
 
-int ec_GFp_simple_group_set_curve_GFp(EC_GROUP *group,
+int ec_GFp_simple_group_set_curve(EC_GROUP *group,
        const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
        {
        int ret = 0;
@@ -158,7 +160,7 @@ int ec_GFp_simple_group_set_curve_GFp(EC_GROUP *group,
        /* p must be a prime > 3 */
        if (BN_num_bits(p) <= 2 || !BN_is_odd(p))
                {
-               ECerr(EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP, EC_R_INVALID_FIELD);
+               ECerr(EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE, EC_R_INVALID_FIELD);
                return 0;
                }
 
@@ -203,7 +205,7 @@ int ec_GFp_simple_group_set_curve_GFp(EC_GROUP *group,
        }
 
 
-int ec_GFp_simple_group_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
+int ec_GFp_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
        {
        int ret = 0;
        BN_CTX *new_ctx = NULL;
@@ -485,13 +487,13 @@ int ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP *group, const E
        }
 
 
-int ec_GFp_simple_point_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point,
+int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *group, EC_POINT *point,
        const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)
        {
        if (x == NULL || y == NULL)
                {
                /* unlike for projective coordinates, we do not tolerate this */
-               ECerr(EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP, ERR_R_PASSED_NULL_PARAMETER);
+               ECerr(EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES, ERR_R_PASSED_NULL_PARAMETER);
                return 0;
                }
 
@@ -499,7 +501,7 @@ int ec_GFp_simple_point_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POI
        }
 
 
-int ec_GFp_simple_point_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *point,
+int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point,
        BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
        {
        BN_CTX *new_ctx = NULL;
@@ -509,7 +511,7 @@ int ec_GFp_simple_point_get_affine_coordinates_GFp(const EC_GROUP *group, const
 
        if (EC_POINT_is_at_infinity(group, point))
                {
-               ECerr(EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP, EC_R_POINT_AT_INFINITY);
+               ECerr(EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES, EC_R_POINT_AT_INFINITY);
                return 0;
                }
 
@@ -560,7 +562,7 @@ int ec_GFp_simple_point_get_affine_coordinates_GFp(const EC_GROUP *group, const
                {
                if (!BN_mod_inverse(Z_1, Z_, &group->field, ctx))
                        {
-                       ECerr(EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP, ERR_R_BN_LIB);
+                       ECerr(EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES, ERR_R_BN_LIB);
                        goto err;
                        }
                
@@ -614,7 +616,7 @@ int ec_GFp_simple_point_get_affine_coordinates_GFp(const EC_GROUP *group, const
        }
 
 
-int ec_GFp_simple_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *point,
+int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point,
        const BIGNUM *x_, int y_bit, BN_CTX *ctx)
        {
        BN_CTX *new_ctx = NULL;
@@ -697,10 +699,10 @@ int ec_GFp_simple_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT
                if (ERR_GET_LIB(err) == ERR_LIB_BN && ERR_GET_REASON(err) == BN_R_NOT_A_SQUARE)
                        {
                        (void)ERR_get_error();
-                       ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP, EC_R_INVALID_COMPRESSED_POINT);
+                       ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, EC_R_INVALID_COMPRESSED_POINT);
                        }
                else
-                       ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP, ERR_R_BN_LIB);
+                       ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, ERR_R_BN_LIB);
                goto err;
                }
        /* If tmp1 is not a square (i.e. there is no point on the curve with
@@ -716,16 +718,16 @@ int ec_GFp_simple_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT
                        if (kron == -2) goto err;
 
                        if (kron == 1)
-                               ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP, EC_R_INVALID_COMPRESSION_BIT);
+                               ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, EC_R_INVALID_COMPRESSION_BIT);
                        else
-                               ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP, EC_R_INVALID_COMPRESSED_POINT);
+                               ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, EC_R_INVALID_COMPRESSED_POINT);
                        goto err;
                        }
                if (!BN_usub(y, &group->field, y)) goto err;
                }
        if (y_bit != BN_is_odd(y))
                {
-               ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP, ERR_R_INTERNAL_ERROR);
+               ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, ERR_R_INTERNAL_ERROR);
                goto err;
                }
 
index 86a71ba14b88b685fd834630a31f585907631310..9d46d150783211f0d3988d127b90f18224f22495 100644 (file)
@@ -1,4 +1,7 @@
 /* crypto/ec/ectest.c */
+/*
+ * Originally written by Bodo Moeller for the OpenSSL project.
+ */
 /* ====================================================================
  * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
  *
index 8f86146b9922196190b686b3e88ba16737737b1f..860f5694d6d474fb4c43e208c1d057e82bca8d6a 100644 (file)
@@ -461,11 +461,11 @@ ectest.o: ../include/openssl/dh.h ../include/openssl/dsa.h
 ectest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
 ectest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
 ectest.o: ../include/openssl/err.h ../include/openssl/lhash.h
-ectest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
-ectest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h
-ectest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
-ectest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
-ectest.o: ../include/openssl/ui.h ectest.c
+ectest.o: ../include/openssl/obj_mac.h ../include/openssl/opensslconf.h
+ectest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+ectest.o: ../include/openssl/rand.h ../include/openssl/rsa.h
+ectest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
+ectest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h ectest.c
 enginetest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
 enginetest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 enginetest.o: ../include/openssl/crypto.h ../include/openssl/dh.h