Loading CHANGES +13 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,19 @@ Changes between 0.9.7 and 0.9.8 [xx XXX 2002] *) Add 'nid' and 'asn1_flag' members to EC_GROUP, and functions EC_GROUP_get_nid() EC_GROUP_get_set_asn1_flag() EC_GROUP_get_get_asn1_flag() 'nid' is an optional NID for named curves. 'asn1_flag' determines the encoding to be used for ASN1 purposes. [Nils Larsch <nla@trustcenter.de>] *) Add 'field_type' member to EC_METHOD, which holds the NID of the appropriate field type OID. The new function EC_METHOD_get_field_type() returns this value. [Nils Larsch <nla@trustcenter.de>] *) Add functions EC_POINT_point2bn() EC_POINT_bn2point() Loading apps/ecdsaparam.c +3 −1 Original line number Diff line number Diff line Loading @@ -431,7 +431,9 @@ bad: goto end; ecdsa->group = EC_GROUP_new_by_name(curve_type); if (named_curve) ECDSA_set_parameter_flags(ecdsa, ECDSA_FLAG_NAMED_CURVE); EC_GROUP_set_asn1_flag(ecdsa->group, OPENSSL_EC_NAMED_CURVE | (EC_GROUP_get_asn1_flag(ecdsa->group) & ~0x3)); } else if (informat == FORMAT_ASN1) ecdsa = d2i_ECDSAParameters_bio(in,NULL); Loading crypto/asn1/x_pubkey.c +10 −5 Original line number Diff line number Diff line Loading @@ -145,7 +145,8 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) goto err; } if ((ECDSA_get_parameter_flags(ecdsa) & ECDSA_FLAG_NAMED_CURVE) && (nid = EC_GROUP_get_nid(ecdsa->group))) if ((EC_GROUP_get_asn1_flag(ecdsa->group) & OPENSSL_EC_NAMED_CURVE) && (nid = EC_GROUP_get_nid(ecdsa->group))) { /* just set the OID */ a->parameter->type = V_ASN1_OBJECT; Loading Loading @@ -302,13 +303,17 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) /* type == V_ASN1_OBJECT => the parameters are given * by an asn1 OID */ ECDSA *ecdsa; if (ret->pkey.ecdsa == NULL) ret->pkey.ecdsa = ECDSA_new(); if (ret->pkey.ecdsa->group) EC_GROUP_free(ret->pkey.ecdsa->group); ret->pkey.ecdsa->parameter_flags |= ECDSA_FLAG_NAMED_CURVE; if ((ret->pkey.ecdsa->group = EC_GROUP_new_by_name(OBJ_obj2nid(a->parameter->value.object))) == NULL) ecdsa = ret->pkey.ecdsa; if (ecdsa->group) EC_GROUP_free(ecdsa->group); if ((ecdsa->group = EC_GROUP_new_by_name( OBJ_obj2nid(a->parameter->value.object))) == NULL) goto err; EC_GROUP_set_asn1_flag(ecdsa->group, OPENSSL_EC_NAMED_CURVE | (EC_GROUP_get_asn1_flag(ecdsa->group) & ~0x03)); } /* the case implicitlyCA is currently not implemented */ ret->save_parameters = 1; Loading crypto/ec/Makefile.ssl +69 −50 Original line number Diff line number Diff line Loading @@ -82,13 +82,14 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. ec_check.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_check.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ec_check.o: ../../include/openssl/ec.h ../../include/openssl/err.h ec_check.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ec_check.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_check.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_check.o: ec_check.c ec_lcl.h ec_check.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_check.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_check.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_check.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ec_check.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_check.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_check.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_check.o: ../../include/openssl/symhacks.h ec_check.c ec_lcl.h ec_curve.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h ec_curve.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_curve.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h Loading @@ -98,53 +99,71 @@ ec_curve.o: ../../include/openssl/opensslconf.h ec_curve.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_curve.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_curve.o: ../../include/openssl/symhacks.h ec_curve.c ec_lcl.h ec_cvt.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h ec_cvt.o: ../../include/openssl/ec.h ../../include/openssl/opensslconf.h ec_cvt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_cvt.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_cvt.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_cvt.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_cvt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_cvt.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_cvt.o: ../../include/openssl/symhacks.h ec_cvt.c ec_lcl.h ec_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ec_err.o: ../../include/openssl/ec.h ../../include/openssl/err.h ec_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ec_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ec_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h ec_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h ec_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_err.o: ec_err.c ec_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ec_lib.o: ../../include/openssl/ec.h ../../include/openssl/err.h ec_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ec_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_lib.o: ec_lcl.h ec_lib.c ec_mult.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_mult.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ec_mult.o: ../../include/openssl/ec.h ../../include/openssl/err.h ec_mult.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_mult.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_mult.o: ec_lcl.h ec_mult.c ec_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_lib.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ec_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_lib.o: ../../include/openssl/symhacks.h ec_lcl.h ec_lib.c ec_mult.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_mult.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_mult.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_mult.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ec_mult.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_mult.o: ../../include/openssl/symhacks.h ec_lcl.h ec_mult.c ec_print.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_print.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_print.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_print.o: ../../include/openssl/opensslconf.h ec_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_print.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_print.o: ec_lcl.h ec_print.c ecp_mont.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ecp_mont.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ecp_mont.o: ../../include/openssl/ec.h ../../include/openssl/err.h ecp_mont.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ecp_mont.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ecp_mont.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ecp_mont.o: ec_lcl.h ecp_mont.c ecp_nist.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h ecp_nist.o: ../../include/openssl/ec.h ../../include/openssl/opensslconf.h ec_print.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_print.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_print.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_print.o: ../../include/openssl/symhacks.h ec_lcl.h ec_print.c ecp_mont.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ecp_mont.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ecp_mont.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ecp_mont.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ecp_mont.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ecp_mont.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ecp_mont.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ecp_mont.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_mont.c ecp_nist.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ecp_nist.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ecp_nist.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ecp_nist.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ecp_nist.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ecp_nist.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ecp_nist.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_nist.c ecp_recp.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h ecp_recp.o: ../../include/openssl/ec.h ../../include/openssl/opensslconf.h ecp_recp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ecp_recp.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ecp_recp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ecp_recp.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ecp_recp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ecp_recp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ecp_recp.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_recp.c ecp_smpl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ecp_smpl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ecp_smpl.o: ../../include/openssl/ec.h ../../include/openssl/err.h ecp_smpl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ecp_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ecp_smpl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ecp_smpl.o: ec_lcl.h ecp_smpl.c ecp_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ecp_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ecp_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ecp_smpl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 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 crypto/ec/ec.h +58 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ #endif #include <openssl/bn.h> #include <openssl/asn1.h> #include <openssl/symhacks.h> #ifdef __cplusplus Loading Loading @@ -108,6 +109,7 @@ void EC_GROUP_clear_free(EC_GROUP *); int EC_GROUP_copy(EC_GROUP *, const EC_GROUP *); const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *); int EC_METHOD_get_field_type(const EC_METHOD *); int EC_GROUP_set_generator(EC_GROUP *, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor); EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *); Loading Loading @@ -226,6 +228,35 @@ int EC_GROUP_precompute_mult(EC_GROUP *, BN_CTX *); /* ASN1 stuff */ #define OPENSSL_EC_EXPLICIT 0x001 #define OPENSSL_EC_NAMED_CURVE 0x002 #define OPENSSL_EC_COMPRESSED 0x010 #define OPENSSL_EC_UNCOMPRESSED 0x020 #define OPENSSL_EC_HYBRID 0x040 typedef struct ec_parameters_st ECPARAMETERS; typedef struct ecpk_parameters_st ECPKPARAMETERS; DECLARE_ASN1_ITEM(ECPARAMETERS) DECLARE_ASN1_ITEM(ECPKPARAMETERS) DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECPARAMETERS, ECPARAMETERS) DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECPKPARAMETERS, ECPKPARAMETERS) EC_GROUP *EC_ASN1_pkparameters2group(const ECPKPARAMETERS *); ECPKPARAMETERS *EC_ASN1_group2pkparameters(const EC_GROUP *, ECPKPARAMETERS *); void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag); int EC_GROUP_get_asn1_flag(const EC_GROUP *); EC_GROUP *d2i_ECParameters(EC_GROUP **, const unsigned char **in, long len); int i2d_ECParameters(const EC_GROUP *, unsigned char **out); EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len); int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. Loading @@ -236,6 +267,15 @@ void ERR_load_EC_strings(void); /* Function codes. */ #define EC_F_COMPUTE_WNAF 143 #define EC_F_D2I_ECDSAPARAMETERS 154 #define EC_F_D2I_ECPARAMETERS 155 #define EC_F_D2I_ECPKPARAMETERS 161 #define EC_F_EC_ASN1_GROUP2CURVE 159 #define EC_F_EC_ASN1_GROUP2FIELDID 156 #define EC_F_EC_ASN1_GROUP2PARAMETERS 160 #define EC_F_EC_ASN1_GROUP2PKPARAMETERS 162 #define EC_F_EC_ASN1_PARAMETERS2GROUP 157 #define EC_F_EC_ASN1_PKPARAMETERS2GROUP 163 #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 Loading Loading @@ -286,10 +326,23 @@ void ERR_load_EC_strings(void); #define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126 #define EC_F_EC_POINT_SET_TO_INFINITY 127 #define EC_F_GFP_MONT_GROUP_SET_CURVE_GFP 135 #define EC_F_I2D_ECDSAPARAMETERS 158 #define EC_F_I2D_ECPARAMETERS 164 #define EC_F_I2D_ECPKPARAMETERS 165 /* Reason codes. */ #define EC_R_ASN1_ERROR 130 #define EC_R_ASN1_UNKNOWN_FIELD 131 #define EC_R_BUFFER_TOO_SMALL 100 #define EC_R_D2I_ECPARAMETERS_FAILURE 132 #define EC_R_D2I_ECPKPARAMETERS_FAILURE 133 #define EC_R_D2I_EC_PARAMETERS_FAILURE 123 #define EC_R_DISCRIMINANT_IS_ZERO 118 #define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 124 #define EC_R_GROUP2PARAMETERS_FAILURE 125 #define EC_R_GROUP2PKPARAMETERS_FAILURE 134 #define EC_R_I2D_ECPKPARAMETERS_FAILURE 135 #define EC_R_I2D_EC_PARAMETERS_FAILURE 126 #define EC_R_INCOMPATIBLE_OBJECTS 101 #define EC_R_INVALID_ARGUMENT 112 #define EC_R_INVALID_COMPRESSED_POINT 110 Loading @@ -298,8 +351,12 @@ void ERR_load_EC_strings(void); #define EC_R_INVALID_FIELD 103 #define EC_R_INVALID_FORM 104 #define EC_R_INVALID_GROUP_ORDER 119 #define EC_R_MISSING_PARAMETERS 127 #define EC_R_NOT_IMPLEMENTED 136 #define EC_R_NOT_INITIALIZED 111 #define EC_R_NO_SUCH_EXTRA_DATA 105 #define EC_R_PARAMETERS2GROUP_FAILURE 128 #define EC_R_PKPARAMETERS2GROUP_FAILURE 137 #define EC_R_POINT_AT_INFINITY 106 #define EC_R_POINT_IS_NOT_ON_CURVE 107 #define EC_R_SLOT_FULL 108 Loading @@ -308,6 +365,7 @@ void ERR_load_EC_strings(void); #define EC_R_UNKNOWN_GROUP 116 #define EC_R_UNKNOWN_NID 117 #define EC_R_UNKNOWN_ORDER 114 #define EC_R_UNKNOWN_PARAMETERS_TYPE 129 #ifdef __cplusplus } Loading Loading
CHANGES +13 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,19 @@ Changes between 0.9.7 and 0.9.8 [xx XXX 2002] *) Add 'nid' and 'asn1_flag' members to EC_GROUP, and functions EC_GROUP_get_nid() EC_GROUP_get_set_asn1_flag() EC_GROUP_get_get_asn1_flag() 'nid' is an optional NID for named curves. 'asn1_flag' determines the encoding to be used for ASN1 purposes. [Nils Larsch <nla@trustcenter.de>] *) Add 'field_type' member to EC_METHOD, which holds the NID of the appropriate field type OID. The new function EC_METHOD_get_field_type() returns this value. [Nils Larsch <nla@trustcenter.de>] *) Add functions EC_POINT_point2bn() EC_POINT_bn2point() Loading
apps/ecdsaparam.c +3 −1 Original line number Diff line number Diff line Loading @@ -431,7 +431,9 @@ bad: goto end; ecdsa->group = EC_GROUP_new_by_name(curve_type); if (named_curve) ECDSA_set_parameter_flags(ecdsa, ECDSA_FLAG_NAMED_CURVE); EC_GROUP_set_asn1_flag(ecdsa->group, OPENSSL_EC_NAMED_CURVE | (EC_GROUP_get_asn1_flag(ecdsa->group) & ~0x3)); } else if (informat == FORMAT_ASN1) ecdsa = d2i_ECDSAParameters_bio(in,NULL); Loading
crypto/asn1/x_pubkey.c +10 −5 Original line number Diff line number Diff line Loading @@ -145,7 +145,8 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) goto err; } if ((ECDSA_get_parameter_flags(ecdsa) & ECDSA_FLAG_NAMED_CURVE) && (nid = EC_GROUP_get_nid(ecdsa->group))) if ((EC_GROUP_get_asn1_flag(ecdsa->group) & OPENSSL_EC_NAMED_CURVE) && (nid = EC_GROUP_get_nid(ecdsa->group))) { /* just set the OID */ a->parameter->type = V_ASN1_OBJECT; Loading Loading @@ -302,13 +303,17 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) /* type == V_ASN1_OBJECT => the parameters are given * by an asn1 OID */ ECDSA *ecdsa; if (ret->pkey.ecdsa == NULL) ret->pkey.ecdsa = ECDSA_new(); if (ret->pkey.ecdsa->group) EC_GROUP_free(ret->pkey.ecdsa->group); ret->pkey.ecdsa->parameter_flags |= ECDSA_FLAG_NAMED_CURVE; if ((ret->pkey.ecdsa->group = EC_GROUP_new_by_name(OBJ_obj2nid(a->parameter->value.object))) == NULL) ecdsa = ret->pkey.ecdsa; if (ecdsa->group) EC_GROUP_free(ecdsa->group); if ((ecdsa->group = EC_GROUP_new_by_name( OBJ_obj2nid(a->parameter->value.object))) == NULL) goto err; EC_GROUP_set_asn1_flag(ecdsa->group, OPENSSL_EC_NAMED_CURVE | (EC_GROUP_get_asn1_flag(ecdsa->group) & ~0x03)); } /* the case implicitlyCA is currently not implemented */ ret->save_parameters = 1; Loading
crypto/ec/Makefile.ssl +69 −50 Original line number Diff line number Diff line Loading @@ -82,13 +82,14 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. ec_check.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_check.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ec_check.o: ../../include/openssl/ec.h ../../include/openssl/err.h ec_check.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ec_check.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_check.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_check.o: ec_check.c ec_lcl.h ec_check.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_check.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_check.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_check.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ec_check.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_check.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_check.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_check.o: ../../include/openssl/symhacks.h ec_check.c ec_lcl.h ec_curve.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h ec_curve.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_curve.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h Loading @@ -98,53 +99,71 @@ ec_curve.o: ../../include/openssl/opensslconf.h ec_curve.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_curve.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_curve.o: ../../include/openssl/symhacks.h ec_curve.c ec_lcl.h ec_cvt.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h ec_cvt.o: ../../include/openssl/ec.h ../../include/openssl/opensslconf.h ec_cvt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_cvt.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_cvt.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_cvt.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_cvt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_cvt.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_cvt.o: ../../include/openssl/symhacks.h ec_cvt.c ec_lcl.h ec_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ec_err.o: ../../include/openssl/ec.h ../../include/openssl/err.h ec_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ec_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ec_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h ec_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h ec_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_err.o: ec_err.c ec_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ec_lib.o: ../../include/openssl/ec.h ../../include/openssl/err.h ec_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ec_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_lib.o: ec_lcl.h ec_lib.c ec_mult.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_mult.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ec_mult.o: ../../include/openssl/ec.h ../../include/openssl/err.h ec_mult.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_mult.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_mult.o: ec_lcl.h ec_mult.c ec_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_lib.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ec_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_lib.o: ../../include/openssl/symhacks.h ec_lcl.h ec_lib.c ec_mult.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_mult.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_mult.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_mult.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ec_mult.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_mult.o: ../../include/openssl/symhacks.h ec_lcl.h ec_mult.c ec_print.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_print.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_print.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ec_print.o: ../../include/openssl/opensslconf.h ec_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ec_print.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ec_print.o: ec_lcl.h ec_print.c ecp_mont.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ecp_mont.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ecp_mont.o: ../../include/openssl/ec.h ../../include/openssl/err.h ecp_mont.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ecp_mont.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ecp_mont.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ecp_mont.o: ec_lcl.h ecp_mont.c ecp_nist.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h ecp_nist.o: ../../include/openssl/ec.h ../../include/openssl/opensslconf.h ec_print.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_print.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_print.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ec_print.o: ../../include/openssl/symhacks.h ec_lcl.h ec_print.c ecp_mont.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ecp_mont.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ecp_mont.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ecp_mont.o: ../../include/openssl/err.h ../../include/openssl/lhash.h ecp_mont.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ecp_mont.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ecp_mont.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ecp_mont.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_mont.c ecp_nist.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ecp_nist.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ecp_nist.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ecp_nist.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ecp_nist.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ecp_nist.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ecp_nist.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_nist.c ecp_recp.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h ecp_recp.o: ../../include/openssl/ec.h ../../include/openssl/opensslconf.h ecp_recp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ecp_recp.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ecp_recp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ecp_recp.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ecp_recp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ecp_recp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h ecp_recp.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_recp.c ecp_smpl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ecp_smpl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h ecp_smpl.o: ../../include/openssl/ec.h ../../include/openssl/err.h ecp_smpl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h ecp_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h ecp_smpl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ecp_smpl.o: ec_lcl.h ecp_smpl.c ecp_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ecp_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ecp_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h ecp_smpl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 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
crypto/ec/ec.h +58 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ #endif #include <openssl/bn.h> #include <openssl/asn1.h> #include <openssl/symhacks.h> #ifdef __cplusplus Loading Loading @@ -108,6 +109,7 @@ void EC_GROUP_clear_free(EC_GROUP *); int EC_GROUP_copy(EC_GROUP *, const EC_GROUP *); const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *); int EC_METHOD_get_field_type(const EC_METHOD *); int EC_GROUP_set_generator(EC_GROUP *, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor); EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *); Loading Loading @@ -226,6 +228,35 @@ int EC_GROUP_precompute_mult(EC_GROUP *, BN_CTX *); /* ASN1 stuff */ #define OPENSSL_EC_EXPLICIT 0x001 #define OPENSSL_EC_NAMED_CURVE 0x002 #define OPENSSL_EC_COMPRESSED 0x010 #define OPENSSL_EC_UNCOMPRESSED 0x020 #define OPENSSL_EC_HYBRID 0x040 typedef struct ec_parameters_st ECPARAMETERS; typedef struct ecpk_parameters_st ECPKPARAMETERS; DECLARE_ASN1_ITEM(ECPARAMETERS) DECLARE_ASN1_ITEM(ECPKPARAMETERS) DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECPARAMETERS, ECPARAMETERS) DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECPKPARAMETERS, ECPKPARAMETERS) EC_GROUP *EC_ASN1_pkparameters2group(const ECPKPARAMETERS *); ECPKPARAMETERS *EC_ASN1_group2pkparameters(const EC_GROUP *, ECPKPARAMETERS *); void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag); int EC_GROUP_get_asn1_flag(const EC_GROUP *); EC_GROUP *d2i_ECParameters(EC_GROUP **, const unsigned char **in, long len); int i2d_ECParameters(const EC_GROUP *, unsigned char **out); EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len); int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. Loading @@ -236,6 +267,15 @@ void ERR_load_EC_strings(void); /* Function codes. */ #define EC_F_COMPUTE_WNAF 143 #define EC_F_D2I_ECDSAPARAMETERS 154 #define EC_F_D2I_ECPARAMETERS 155 #define EC_F_D2I_ECPKPARAMETERS 161 #define EC_F_EC_ASN1_GROUP2CURVE 159 #define EC_F_EC_ASN1_GROUP2FIELDID 156 #define EC_F_EC_ASN1_GROUP2PARAMETERS 160 #define EC_F_EC_ASN1_GROUP2PKPARAMETERS 162 #define EC_F_EC_ASN1_PARAMETERS2GROUP 157 #define EC_F_EC_ASN1_PKPARAMETERS2GROUP 163 #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 Loading Loading @@ -286,10 +326,23 @@ void ERR_load_EC_strings(void); #define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126 #define EC_F_EC_POINT_SET_TO_INFINITY 127 #define EC_F_GFP_MONT_GROUP_SET_CURVE_GFP 135 #define EC_F_I2D_ECDSAPARAMETERS 158 #define EC_F_I2D_ECPARAMETERS 164 #define EC_F_I2D_ECPKPARAMETERS 165 /* Reason codes. */ #define EC_R_ASN1_ERROR 130 #define EC_R_ASN1_UNKNOWN_FIELD 131 #define EC_R_BUFFER_TOO_SMALL 100 #define EC_R_D2I_ECPARAMETERS_FAILURE 132 #define EC_R_D2I_ECPKPARAMETERS_FAILURE 133 #define EC_R_D2I_EC_PARAMETERS_FAILURE 123 #define EC_R_DISCRIMINANT_IS_ZERO 118 #define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 124 #define EC_R_GROUP2PARAMETERS_FAILURE 125 #define EC_R_GROUP2PKPARAMETERS_FAILURE 134 #define EC_R_I2D_ECPKPARAMETERS_FAILURE 135 #define EC_R_I2D_EC_PARAMETERS_FAILURE 126 #define EC_R_INCOMPATIBLE_OBJECTS 101 #define EC_R_INVALID_ARGUMENT 112 #define EC_R_INVALID_COMPRESSED_POINT 110 Loading @@ -298,8 +351,12 @@ void ERR_load_EC_strings(void); #define EC_R_INVALID_FIELD 103 #define EC_R_INVALID_FORM 104 #define EC_R_INVALID_GROUP_ORDER 119 #define EC_R_MISSING_PARAMETERS 127 #define EC_R_NOT_IMPLEMENTED 136 #define EC_R_NOT_INITIALIZED 111 #define EC_R_NO_SUCH_EXTRA_DATA 105 #define EC_R_PARAMETERS2GROUP_FAILURE 128 #define EC_R_PKPARAMETERS2GROUP_FAILURE 137 #define EC_R_POINT_AT_INFINITY 106 #define EC_R_POINT_IS_NOT_ON_CURVE 107 #define EC_R_SLOT_FULL 108 Loading @@ -308,6 +365,7 @@ void ERR_load_EC_strings(void); #define EC_R_UNKNOWN_GROUP 116 #define EC_R_UNKNOWN_NID 117 #define EC_R_UNKNOWN_ORDER 114 #define EC_R_UNKNOWN_PARAMETERS_TYPE 129 #ifdef __cplusplus } Loading