Update from 0.9.8 stable. Eliminate duplicate error codes.
[openssl.git] / crypto / ec / ec.h
index a3fec5a2df661867f3fb56b5a486dca8c449bf7c..26d92a569ec9966b059631dff984e067afbc7122 100644 (file)
@@ -96,6 +96,11 @@ extern "C" {
 # endif
 #endif
 
+  
+#ifndef OPENSSL_ECC_MAX_FIELD_BITS
+# define OPENSSL_ECC_MAX_FIELD_BITS 661
+#endif
+
 /** Enum for the point conversion form as defined in X9.62 (ECDSA)
  *  for the encoding of a elliptic curve point (x,y) */
 typedef enum {
@@ -905,6 +910,13 @@ int        EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
 # endif
 #endif
 
+#define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid) \
+       EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_PARAMGEN, \
+                               EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL)
+
+
+#define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID            (EVP_PKEY_ALG_CTRL + 1)
+
 /* 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.
@@ -918,6 +930,14 @@ void ERR_load_EC_strings(void);
 #define EC_F_D2I_ECPARAMETERS                           144
 #define EC_F_D2I_ECPKPARAMETERS                                 145
 #define EC_F_D2I_ECPRIVATEKEY                           146
+#define EC_F_DO_EC_KEY_PRINT                            221
+#define EC_F_ECKEY_PARAM2TYPE                           196
+#define EC_F_ECKEY_PARAM_DECODE                                 212
+#define EC_F_ECKEY_PRIV_DECODE                          213
+#define EC_F_ECKEY_PRIV_ENCODE                          214
+#define EC_F_ECKEY_PUB_DECODE                           215
+#define EC_F_ECKEY_PUB_ENCODE                           216
+#define EC_F_ECKEY_TYPE2PARAM                           220
 #define EC_F_ECPARAMETERS_PRINT                                 147
 #define EC_F_ECPARAMETERS_PRINT_FP                      148
 #define EC_F_ECPKPARAMETERS_PRINT                       149
@@ -976,7 +996,6 @@ void ERR_load_EC_strings(void);
 #define EC_F_EC_GROUP_GET_ORDER                                 141
 #define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS             193
 #define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS               194
-#define EC_F_EC_GROUP_GROUP2NID                                 147
 #define EC_F_EC_GROUP_NEW                               108
 #define EC_F_EC_GROUP_NEW_BY_CURVE_NAME                         174
 #define EC_F_EC_GROUP_NEW_FROM_DATA                     175
@@ -992,7 +1011,6 @@ void ERR_load_EC_strings(void);
 #define EC_F_EC_KEY_PRINT                               180
 #define EC_F_EC_KEY_PRINT_FP                            181
 #define EC_F_EC_POINTS_MAKE_AFFINE                      136
-#define EC_F_EC_POINTS_MUL                              138
 #define EC_F_EC_POINT_ADD                               112
 #define EC_F_EC_POINT_CMP                               113
 #define EC_F_EC_POINT_COPY                              114
@@ -1022,25 +1040,39 @@ void ERR_load_EC_strings(void);
 #define EC_F_I2D_ECPRIVATEKEY                           192
 #define EC_F_I2O_ECPUBLICKEY                            151
 #define EC_F_O2I_ECPUBLICKEY                            152
+#define EC_F_OLD_EC_PRIV_DECODE                                 222
+#define EC_F_PKEY_EC_CTRL                               197
+#define EC_F_PKEY_EC_CTRL_STR                           198
+#define EC_F_PKEY_EC_DERIVE                             217
+#define EC_F_PKEY_EC_KEYGEN                             199
+#define EC_F_PKEY_EC_PARAMGEN                           219
+#define EC_F_PKEY_EC_SIGN                               218
 
 /* Reason codes. */
 #define EC_R_ASN1_ERROR                                         115
 #define EC_R_ASN1_UNKNOWN_FIELD                                 116
 #define EC_R_BUFFER_TOO_SMALL                           100
 #define EC_R_D2I_ECPKPARAMETERS_FAILURE                         117
+#define EC_R_DECODE_ERROR                               142
 #define EC_R_DISCRIMINANT_IS_ZERO                       118
 #define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE               119
+#define EC_R_FIELD_TOO_LARGE                            138
 #define EC_R_GROUP2PKPARAMETERS_FAILURE                         120
 #define EC_R_I2D_ECPKPARAMETERS_FAILURE                         121
 #define EC_R_INCOMPATIBLE_OBJECTS                       101
 #define EC_R_INVALID_ARGUMENT                           112
 #define EC_R_INVALID_COMPRESSED_POINT                   110
 #define EC_R_INVALID_COMPRESSION_BIT                    109
+#define EC_R_INVALID_CURVE                              141
+#define EC_R_INVALID_DIGEST_TYPE                        138
 #define EC_R_INVALID_ENCODING                           102
 #define EC_R_INVALID_FIELD                              103
 #define EC_R_INVALID_FORM                               104
 #define EC_R_INVALID_GROUP_ORDER                        122
+#define EC_R_INVALID_PENTANOMIAL_BASIS                  132
 #define EC_R_INVALID_PRIVATE_KEY                        123
+#define EC_R_INVALID_TRINOMIAL_BASIS                    137
+#define EC_R_KEYS_NOT_SET                               140
 #define EC_R_MISSING_PARAMETERS                                 124
 #define EC_R_MISSING_PRIVATE_KEY                        125
 #define EC_R_NOT_A_NIST_PRIME                           135
@@ -1048,6 +1080,7 @@ void ERR_load_EC_strings(void);
 #define EC_R_NOT_IMPLEMENTED                            126
 #define EC_R_NOT_INITIALIZED                            111
 #define EC_R_NO_FIELD_MOD                               133
+#define EC_R_NO_PARAMETERS_SET                          139
 #define EC_R_PASSED_NULL_PARAMETER                      134
 #define EC_R_PKPARAMETERS2GROUP_FAILURE                         127
 #define EC_R_POINT_AT_INFINITY                          106