Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef __ecl_exp_h_ |
michael@0 | 6 | #define __ecl_exp_h_ |
michael@0 | 7 | |
michael@0 | 8 | /* Curve field type */ |
michael@0 | 9 | typedef enum { |
michael@0 | 10 | ECField_GFp, |
michael@0 | 11 | ECField_GF2m |
michael@0 | 12 | } ECField; |
michael@0 | 13 | |
michael@0 | 14 | /* Hexadecimal encoding of curve parameters */ |
michael@0 | 15 | struct ECCurveParamsStr { |
michael@0 | 16 | char *text; |
michael@0 | 17 | ECField field; |
michael@0 | 18 | unsigned int size; |
michael@0 | 19 | char *irr; |
michael@0 | 20 | char *curvea; |
michael@0 | 21 | char *curveb; |
michael@0 | 22 | char *genx; |
michael@0 | 23 | char *geny; |
michael@0 | 24 | char *order; |
michael@0 | 25 | int cofactor; |
michael@0 | 26 | }; |
michael@0 | 27 | typedef struct ECCurveParamsStr ECCurveParams; |
michael@0 | 28 | |
michael@0 | 29 | /* Named curve parameters */ |
michael@0 | 30 | typedef enum { |
michael@0 | 31 | |
michael@0 | 32 | ECCurve_noName = 0, |
michael@0 | 33 | |
michael@0 | 34 | /* NIST prime curves */ |
michael@0 | 35 | ECCurve_NIST_P192, |
michael@0 | 36 | ECCurve_NIST_P224, |
michael@0 | 37 | ECCurve_NIST_P256, |
michael@0 | 38 | ECCurve_NIST_P384, |
michael@0 | 39 | ECCurve_NIST_P521, |
michael@0 | 40 | |
michael@0 | 41 | /* NIST binary curves */ |
michael@0 | 42 | ECCurve_NIST_K163, |
michael@0 | 43 | ECCurve_NIST_B163, |
michael@0 | 44 | ECCurve_NIST_K233, |
michael@0 | 45 | ECCurve_NIST_B233, |
michael@0 | 46 | ECCurve_NIST_K283, |
michael@0 | 47 | ECCurve_NIST_B283, |
michael@0 | 48 | ECCurve_NIST_K409, |
michael@0 | 49 | ECCurve_NIST_B409, |
michael@0 | 50 | ECCurve_NIST_K571, |
michael@0 | 51 | ECCurve_NIST_B571, |
michael@0 | 52 | |
michael@0 | 53 | /* ANSI X9.62 prime curves */ |
michael@0 | 54 | /* ECCurve_X9_62_PRIME_192V1 == ECCurve_NIST_P192 */ |
michael@0 | 55 | ECCurve_X9_62_PRIME_192V2, |
michael@0 | 56 | ECCurve_X9_62_PRIME_192V3, |
michael@0 | 57 | ECCurve_X9_62_PRIME_239V1, |
michael@0 | 58 | ECCurve_X9_62_PRIME_239V2, |
michael@0 | 59 | ECCurve_X9_62_PRIME_239V3, |
michael@0 | 60 | /* ECCurve_X9_62_PRIME_256V1 == ECCurve_NIST_P256 */ |
michael@0 | 61 | |
michael@0 | 62 | /* ANSI X9.62 binary curves */ |
michael@0 | 63 | ECCurve_X9_62_CHAR2_PNB163V1, |
michael@0 | 64 | ECCurve_X9_62_CHAR2_PNB163V2, |
michael@0 | 65 | ECCurve_X9_62_CHAR2_PNB163V3, |
michael@0 | 66 | ECCurve_X9_62_CHAR2_PNB176V1, |
michael@0 | 67 | ECCurve_X9_62_CHAR2_TNB191V1, |
michael@0 | 68 | ECCurve_X9_62_CHAR2_TNB191V2, |
michael@0 | 69 | ECCurve_X9_62_CHAR2_TNB191V3, |
michael@0 | 70 | ECCurve_X9_62_CHAR2_PNB208W1, |
michael@0 | 71 | ECCurve_X9_62_CHAR2_TNB239V1, |
michael@0 | 72 | ECCurve_X9_62_CHAR2_TNB239V2, |
michael@0 | 73 | ECCurve_X9_62_CHAR2_TNB239V3, |
michael@0 | 74 | ECCurve_X9_62_CHAR2_PNB272W1, |
michael@0 | 75 | ECCurve_X9_62_CHAR2_PNB304W1, |
michael@0 | 76 | ECCurve_X9_62_CHAR2_TNB359V1, |
michael@0 | 77 | ECCurve_X9_62_CHAR2_PNB368W1, |
michael@0 | 78 | ECCurve_X9_62_CHAR2_TNB431R1, |
michael@0 | 79 | |
michael@0 | 80 | /* SEC2 prime curves */ |
michael@0 | 81 | ECCurve_SECG_PRIME_112R1, |
michael@0 | 82 | ECCurve_SECG_PRIME_112R2, |
michael@0 | 83 | ECCurve_SECG_PRIME_128R1, |
michael@0 | 84 | ECCurve_SECG_PRIME_128R2, |
michael@0 | 85 | ECCurve_SECG_PRIME_160K1, |
michael@0 | 86 | ECCurve_SECG_PRIME_160R1, |
michael@0 | 87 | ECCurve_SECG_PRIME_160R2, |
michael@0 | 88 | ECCurve_SECG_PRIME_192K1, |
michael@0 | 89 | /* ECCurve_SECG_PRIME_192R1 == ECCurve_NIST_P192 */ |
michael@0 | 90 | ECCurve_SECG_PRIME_224K1, |
michael@0 | 91 | /* ECCurve_SECG_PRIME_224R1 == ECCurve_NIST_P224 */ |
michael@0 | 92 | ECCurve_SECG_PRIME_256K1, |
michael@0 | 93 | /* ECCurve_SECG_PRIME_256R1 == ECCurve_NIST_P256 */ |
michael@0 | 94 | /* ECCurve_SECG_PRIME_384R1 == ECCurve_NIST_P384 */ |
michael@0 | 95 | /* ECCurve_SECG_PRIME_521R1 == ECCurve_NIST_P521 */ |
michael@0 | 96 | |
michael@0 | 97 | /* SEC2 binary curves */ |
michael@0 | 98 | ECCurve_SECG_CHAR2_113R1, |
michael@0 | 99 | ECCurve_SECG_CHAR2_113R2, |
michael@0 | 100 | ECCurve_SECG_CHAR2_131R1, |
michael@0 | 101 | ECCurve_SECG_CHAR2_131R2, |
michael@0 | 102 | /* ECCurve_SECG_CHAR2_163K1 == ECCurve_NIST_K163 */ |
michael@0 | 103 | ECCurve_SECG_CHAR2_163R1, |
michael@0 | 104 | /* ECCurve_SECG_CHAR2_163R2 == ECCurve_NIST_B163 */ |
michael@0 | 105 | ECCurve_SECG_CHAR2_193R1, |
michael@0 | 106 | ECCurve_SECG_CHAR2_193R2, |
michael@0 | 107 | /* ECCurve_SECG_CHAR2_233K1 == ECCurve_NIST_K233 */ |
michael@0 | 108 | /* ECCurve_SECG_CHAR2_233R1 == ECCurve_NIST_B233 */ |
michael@0 | 109 | ECCurve_SECG_CHAR2_239K1, |
michael@0 | 110 | /* ECCurve_SECG_CHAR2_283K1 == ECCurve_NIST_K283 */ |
michael@0 | 111 | /* ECCurve_SECG_CHAR2_283R1 == ECCurve_NIST_B283 */ |
michael@0 | 112 | /* ECCurve_SECG_CHAR2_409K1 == ECCurve_NIST_K409 */ |
michael@0 | 113 | /* ECCurve_SECG_CHAR2_409R1 == ECCurve_NIST_B409 */ |
michael@0 | 114 | /* ECCurve_SECG_CHAR2_571K1 == ECCurve_NIST_K571 */ |
michael@0 | 115 | /* ECCurve_SECG_CHAR2_571R1 == ECCurve_NIST_B571 */ |
michael@0 | 116 | |
michael@0 | 117 | /* WTLS curves */ |
michael@0 | 118 | ECCurve_WTLS_1, |
michael@0 | 119 | /* there is no WTLS 2 curve */ |
michael@0 | 120 | /* ECCurve_WTLS_3 == ECCurve_NIST_K163 */ |
michael@0 | 121 | /* ECCurve_WTLS_4 == ECCurve_SECG_CHAR2_113R1 */ |
michael@0 | 122 | /* ECCurve_WTLS_5 == ECCurve_X9_62_CHAR2_PNB163V1 */ |
michael@0 | 123 | /* ECCurve_WTLS_6 == ECCurve_SECG_PRIME_112R1 */ |
michael@0 | 124 | /* ECCurve_WTLS_7 == ECCurve_SECG_PRIME_160R1 */ |
michael@0 | 125 | ECCurve_WTLS_8, |
michael@0 | 126 | ECCurve_WTLS_9, |
michael@0 | 127 | /* ECCurve_WTLS_10 == ECCurve_NIST_K233 */ |
michael@0 | 128 | /* ECCurve_WTLS_11 == ECCurve_NIST_B233 */ |
michael@0 | 129 | /* ECCurve_WTLS_12 == ECCurve_NIST_P224 */ |
michael@0 | 130 | |
michael@0 | 131 | ECCurve_pastLastCurve |
michael@0 | 132 | } ECCurveName; |
michael@0 | 133 | |
michael@0 | 134 | /* Aliased named curves */ |
michael@0 | 135 | |
michael@0 | 136 | #define ECCurve_X9_62_PRIME_192V1 ECCurve_NIST_P192 |
michael@0 | 137 | #define ECCurve_X9_62_PRIME_256V1 ECCurve_NIST_P256 |
michael@0 | 138 | #define ECCurve_SECG_PRIME_192R1 ECCurve_NIST_P192 |
michael@0 | 139 | #define ECCurve_SECG_PRIME_224R1 ECCurve_NIST_P224 |
michael@0 | 140 | #define ECCurve_SECG_PRIME_256R1 ECCurve_NIST_P256 |
michael@0 | 141 | #define ECCurve_SECG_PRIME_384R1 ECCurve_NIST_P384 |
michael@0 | 142 | #define ECCurve_SECG_PRIME_521R1 ECCurve_NIST_P521 |
michael@0 | 143 | #define ECCurve_SECG_CHAR2_163K1 ECCurve_NIST_K163 |
michael@0 | 144 | #define ECCurve_SECG_CHAR2_163R2 ECCurve_NIST_B163 |
michael@0 | 145 | #define ECCurve_SECG_CHAR2_233K1 ECCurve_NIST_K233 |
michael@0 | 146 | #define ECCurve_SECG_CHAR2_233R1 ECCurve_NIST_B233 |
michael@0 | 147 | #define ECCurve_SECG_CHAR2_283K1 ECCurve_NIST_K283 |
michael@0 | 148 | #define ECCurve_SECG_CHAR2_283R1 ECCurve_NIST_B283 |
michael@0 | 149 | #define ECCurve_SECG_CHAR2_409K1 ECCurve_NIST_K409 |
michael@0 | 150 | #define ECCurve_SECG_CHAR2_409R1 ECCurve_NIST_B409 |
michael@0 | 151 | #define ECCurve_SECG_CHAR2_571K1 ECCurve_NIST_K571 |
michael@0 | 152 | #define ECCurve_SECG_CHAR2_571R1 ECCurve_NIST_B571 |
michael@0 | 153 | #define ECCurve_WTLS_3 ECCurve_NIST_K163 |
michael@0 | 154 | #define ECCurve_WTLS_4 ECCurve_SECG_CHAR2_113R1 |
michael@0 | 155 | #define ECCurve_WTLS_5 ECCurve_X9_62_CHAR2_PNB163V1 |
michael@0 | 156 | #define ECCurve_WTLS_6 ECCurve_SECG_PRIME_112R1 |
michael@0 | 157 | #define ECCurve_WTLS_7 ECCurve_SECG_PRIME_160R1 |
michael@0 | 158 | #define ECCurve_WTLS_10 ECCurve_NIST_K233 |
michael@0 | 159 | #define ECCurve_WTLS_11 ECCurve_NIST_B233 |
michael@0 | 160 | #define ECCurve_WTLS_12 ECCurve_NIST_P224 |
michael@0 | 161 | |
michael@0 | 162 | #endif /* __ecl_exp_h_ */ |