1/*
2 * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved.
3 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
4 *
5 * Licensed under the Apache License 2.0 (the "License"). You may not use
6 * this file except in compliance with the License. You can obtain a copy
7 * in the file LICENSE in the source distribution or at
8 * https://www.openssl.org/source/license.html
9 */
10
11#include <string.h>
12#include "ec_local.h"
13#include <openssl/err.h>
14#include <openssl/obj_mac.h>
15#include <openssl/opensslconf.h>
16#include "internal/nelem.h"
17
18typedef struct {
19 int field_type, /* either NID_X9_62_prime_field or
20 * NID_X9_62_characteristic_two_field */
21 seed_len, param_len;
22 unsigned int cofactor; /* promoted to BN_ULONG */
23} EC_CURVE_DATA;
24
25/* the nist prime curves */
26static const struct {
27 EC_CURVE_DATA h;
28 unsigned char data[20 + 24 * 6];
29} _EC_NIST_PRIME_192 = {
30 {
31 NID_X9_62_prime_field, 20, 24, 1
32 },
33 {
34 /* seed */
35 0x30, 0x45, 0xAE, 0x6F, 0xC8, 0x42, 0x2F, 0x64, 0xED, 0x57, 0x95, 0x28,
36 0xD3, 0x81, 0x20, 0xEA, 0xE1, 0x21, 0x96, 0xD5,
37 /* p */
38 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
39 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
40 /* a */
41 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
42 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
43 /* b */
44 0x64, 0x21, 0x05, 0x19, 0xE5, 0x9C, 0x80, 0xE7, 0x0F, 0xA7, 0xE9, 0xAB,
45 0x72, 0x24, 0x30, 0x49, 0xFE, 0xB8, 0xDE, 0xEC, 0xC1, 0x46, 0xB9, 0xB1,
46 /* x */
47 0x18, 0x8D, 0xA8, 0x0E, 0xB0, 0x30, 0x90, 0xF6, 0x7C, 0xBF, 0x20, 0xEB,
48 0x43, 0xA1, 0x88, 0x00, 0xF4, 0xFF, 0x0A, 0xFD, 0x82, 0xFF, 0x10, 0x12,
49 /* y */
50 0x07, 0x19, 0x2b, 0x95, 0xff, 0xc8, 0xda, 0x78, 0x63, 0x10, 0x11, 0xed,
51 0x6b, 0x24, 0xcd, 0xd5, 0x73, 0xf9, 0x77, 0xa1, 0x1e, 0x79, 0x48, 0x11,
52 /* order */
53 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
54 0x99, 0xDE, 0xF8, 0x36, 0x14, 0x6B, 0xC9, 0xB1, 0xB4, 0xD2, 0x28, 0x31
55 }
56};
57
58static const struct {
59 EC_CURVE_DATA h;
60 unsigned char data[20 + 28 * 6];
61} _EC_NIST_PRIME_224 = {
62 {
63 NID_X9_62_prime_field, 20, 28, 1
64 },
65 {
66 /* seed */
67 0xBD, 0x71, 0x34, 0x47, 0x99, 0xD5, 0xC7, 0xFC, 0xDC, 0x45, 0xB5, 0x9F,
68 0xA3, 0xB9, 0xAB, 0x8F, 0x6A, 0x94, 0x8B, 0xC5,
69 /* p */
70 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
71 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
72 0x00, 0x00, 0x00, 0x01,
73 /* a */
74 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
75 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
76 0xFF, 0xFF, 0xFF, 0xFE,
77 /* b */
78 0xB4, 0x05, 0x0A, 0x85, 0x0C, 0x04, 0xB3, 0xAB, 0xF5, 0x41, 0x32, 0x56,
79 0x50, 0x44, 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA, 0x27, 0x0B, 0x39, 0x43,
80 0x23, 0x55, 0xFF, 0xB4,
81 /* x */
82 0xB7, 0x0E, 0x0C, 0xBD, 0x6B, 0xB4, 0xBF, 0x7F, 0x32, 0x13, 0x90, 0xB9,
83 0x4A, 0x03, 0xC1, 0xD3, 0x56, 0xC2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xD6,
84 0x11, 0x5C, 0x1D, 0x21,
85 /* y */
86 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb, 0x4c, 0x22, 0xdf, 0xe6,
87 0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99,
88 0x85, 0x00, 0x7e, 0x34,
89 /* order */
90 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
91 0xFF, 0xFF, 0x16, 0xA2, 0xE0, 0xB8, 0xF0, 0x3E, 0x13, 0xDD, 0x29, 0x45,
92 0x5C, 0x5C, 0x2A, 0x3D
93 }
94};
95
96static const struct {
97 EC_CURVE_DATA h;
98 unsigned char data[20 + 48 * 6];
99} _EC_NIST_PRIME_384 = {
100 {
101 NID_X9_62_prime_field, 20, 48, 1
102 },
103 {
104 /* seed */
105 0xA3, 0x35, 0x92, 0x6A, 0xA3, 0x19, 0xA2, 0x7A, 0x1D, 0x00, 0x89, 0x6A,
106 0x67, 0x73, 0xA4, 0x82, 0x7A, 0xCD, 0xAC, 0x73,
107 /* p */
108 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
109 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
110 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
111 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
112 /* a */
113 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
114 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
115 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
116 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFC,
117 /* b */
118 0xB3, 0x31, 0x2F, 0xA7, 0xE2, 0x3E, 0xE7, 0xE4, 0x98, 0x8E, 0x05, 0x6B,
119 0xE3, 0xF8, 0x2D, 0x19, 0x18, 0x1D, 0x9C, 0x6E, 0xFE, 0x81, 0x41, 0x12,
120 0x03, 0x14, 0x08, 0x8F, 0x50, 0x13, 0x87, 0x5A, 0xC6, 0x56, 0x39, 0x8D,
121 0x8A, 0x2E, 0xD1, 0x9D, 0x2A, 0x85, 0xC8, 0xED, 0xD3, 0xEC, 0x2A, 0xEF,
122 /* x */
123 0xAA, 0x87, 0xCA, 0x22, 0xBE, 0x8B, 0x05, 0x37, 0x8E, 0xB1, 0xC7, 0x1E,
124 0xF3, 0x20, 0xAD, 0x74, 0x6E, 0x1D, 0x3B, 0x62, 0x8B, 0xA7, 0x9B, 0x98,
125 0x59, 0xF7, 0x41, 0xE0, 0x82, 0x54, 0x2A, 0x38, 0x55, 0x02, 0xF2, 0x5D,
126 0xBF, 0x55, 0x29, 0x6C, 0x3A, 0x54, 0x5E, 0x38, 0x72, 0x76, 0x0A, 0xB7,
127 /* y */
128 0x36, 0x17, 0xde, 0x4a, 0x96, 0x26, 0x2c, 0x6f, 0x5d, 0x9e, 0x98, 0xbf,
129 0x92, 0x92, 0xdc, 0x29, 0xf8, 0xf4, 0x1d, 0xbd, 0x28, 0x9a, 0x14, 0x7c,
130 0xe9, 0xda, 0x31, 0x13, 0xb5, 0xf0, 0xb8, 0xc0, 0x0a, 0x60, 0xb1, 0xce,
131 0x1d, 0x7e, 0x81, 0x9d, 0x7a, 0x43, 0x1d, 0x7c, 0x90, 0xea, 0x0e, 0x5f,
132 /* order */
133 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
134 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
135 0xC7, 0x63, 0x4D, 0x81, 0xF4, 0x37, 0x2D, 0xDF, 0x58, 0x1A, 0x0D, 0xB2,
136 0x48, 0xB0, 0xA7, 0x7A, 0xEC, 0xEC, 0x19, 0x6A, 0xCC, 0xC5, 0x29, 0x73
137 }
138};
139
140static const struct {
141 EC_CURVE_DATA h;
142 unsigned char data[20 + 66 * 6];
143} _EC_NIST_PRIME_521 = {
144 {
145 NID_X9_62_prime_field, 20, 66, 1
146 },
147 {
148 /* seed */
149 0xD0, 0x9E, 0x88, 0x00, 0x29, 0x1C, 0xB8, 0x53, 0x96, 0xCC, 0x67, 0x17,
150 0x39, 0x32, 0x84, 0xAA, 0xA0, 0xDA, 0x64, 0xBA,
151 /* p */
152 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
153 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
154 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
155 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
156 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
157 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
158 /* a */
159 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
160 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
161 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
162 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
163 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
164 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
165 /* b */
166 0x00, 0x51, 0x95, 0x3E, 0xB9, 0x61, 0x8E, 0x1C, 0x9A, 0x1F, 0x92, 0x9A,
167 0x21, 0xA0, 0xB6, 0x85, 0x40, 0xEE, 0xA2, 0xDA, 0x72, 0x5B, 0x99, 0xB3,
168 0x15, 0xF3, 0xB8, 0xB4, 0x89, 0x91, 0x8E, 0xF1, 0x09, 0xE1, 0x56, 0x19,
169 0x39, 0x51, 0xEC, 0x7E, 0x93, 0x7B, 0x16, 0x52, 0xC0, 0xBD, 0x3B, 0xB1,
170 0xBF, 0x07, 0x35, 0x73, 0xDF, 0x88, 0x3D, 0x2C, 0x34, 0xF1, 0xEF, 0x45,
171 0x1F, 0xD4, 0x6B, 0x50, 0x3F, 0x00,
172 /* x */
173 0x00, 0xC6, 0x85, 0x8E, 0x06, 0xB7, 0x04, 0x04, 0xE9, 0xCD, 0x9E, 0x3E,
174 0xCB, 0x66, 0x23, 0x95, 0xB4, 0x42, 0x9C, 0x64, 0x81, 0x39, 0x05, 0x3F,
175 0xB5, 0x21, 0xF8, 0x28, 0xAF, 0x60, 0x6B, 0x4D, 0x3D, 0xBA, 0xA1, 0x4B,
176 0x5E, 0x77, 0xEF, 0xE7, 0x59, 0x28, 0xFE, 0x1D, 0xC1, 0x27, 0xA2, 0xFF,
177 0xA8, 0xDE, 0x33, 0x48, 0xB3, 0xC1, 0x85, 0x6A, 0x42, 0x9B, 0xF9, 0x7E,
178 0x7E, 0x31, 0xC2, 0xE5, 0xBD, 0x66,
179 /* y */
180 0x01, 0x18, 0x39, 0x29, 0x6a, 0x78, 0x9a, 0x3b, 0xc0, 0x04, 0x5c, 0x8a,
181 0x5f, 0xb4, 0x2c, 0x7d, 0x1b, 0xd9, 0x98, 0xf5, 0x44, 0x49, 0x57, 0x9b,
182 0x44, 0x68, 0x17, 0xaf, 0xbd, 0x17, 0x27, 0x3e, 0x66, 0x2c, 0x97, 0xee,
183 0x72, 0x99, 0x5e, 0xf4, 0x26, 0x40, 0xc5, 0x50, 0xb9, 0x01, 0x3f, 0xad,
184 0x07, 0x61, 0x35, 0x3c, 0x70, 0x86, 0xa2, 0x72, 0xc2, 0x40, 0x88, 0xbe,
185 0x94, 0x76, 0x9f, 0xd1, 0x66, 0x50,
186 /* order */
187 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
188 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
189 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x51, 0x86,
190 0x87, 0x83, 0xBF, 0x2F, 0x96, 0x6B, 0x7F, 0xCC, 0x01, 0x48, 0xF7, 0x09,
191 0xA5, 0xD0, 0x3B, 0xB5, 0xC9, 0xB8, 0x89, 0x9C, 0x47, 0xAE, 0xBB, 0x6F,
192 0xB7, 0x1E, 0x91, 0x38, 0x64, 0x09
193 }
194};
195
196# ifndef FIPS_MODE
197/* the x9.62 prime curves (minus the nist prime curves) */
198static const struct {
199 EC_CURVE_DATA h;
200 unsigned char data[20 + 24 * 6];
201} _EC_X9_62_PRIME_192V2 = {
202 {
203 NID_X9_62_prime_field, 20, 24, 1
204 },
205 {
206 /* seed */
207 0x31, 0xA9, 0x2E, 0xE2, 0x02, 0x9F, 0xD1, 0x0D, 0x90, 0x1B, 0x11, 0x3E,
208 0x99, 0x07, 0x10, 0xF0, 0xD2, 0x1A, 0xC6, 0xB6,
209 /* p */
210 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
211 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
212 /* a */
213 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
214 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
215 /* b */
216 0xCC, 0x22, 0xD6, 0xDF, 0xB9, 0x5C, 0x6B, 0x25, 0xE4, 0x9C, 0x0D, 0x63,
217 0x64, 0xA4, 0xE5, 0x98, 0x0C, 0x39, 0x3A, 0xA2, 0x16, 0x68, 0xD9, 0x53,
218 /* x */
219 0xEE, 0xA2, 0xBA, 0xE7, 0xE1, 0x49, 0x78, 0x42, 0xF2, 0xDE, 0x77, 0x69,
220 0xCF, 0xE9, 0xC9, 0x89, 0xC0, 0x72, 0xAD, 0x69, 0x6F, 0x48, 0x03, 0x4A,
221 /* y */
222 0x65, 0x74, 0xd1, 0x1d, 0x69, 0xb6, 0xec, 0x7a, 0x67, 0x2b, 0xb8, 0x2a,
223 0x08, 0x3d, 0xf2, 0xf2, 0xb0, 0x84, 0x7d, 0xe9, 0x70, 0xb2, 0xde, 0x15,
224 /* order */
225 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
226 0x5F, 0xB1, 0xA7, 0x24, 0xDC, 0x80, 0x41, 0x86, 0x48, 0xD8, 0xDD, 0x31
227 }
228};
229
230static const struct {
231 EC_CURVE_DATA h;
232 unsigned char data[20 + 24 * 6];
233} _EC_X9_62_PRIME_192V3 = {
234 {
235 NID_X9_62_prime_field, 20, 24, 1
236 },
237 {
238 /* seed */
239 0xC4, 0x69, 0x68, 0x44, 0x35, 0xDE, 0xB3, 0x78, 0xC4, 0xB6, 0x5C, 0xA9,
240 0x59, 0x1E, 0x2A, 0x57, 0x63, 0x05, 0x9A, 0x2E,
241 /* p */
242 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
243 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
244 /* a */
245 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
246 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
247 /* b */
248 0x22, 0x12, 0x3D, 0xC2, 0x39, 0x5A, 0x05, 0xCA, 0xA7, 0x42, 0x3D, 0xAE,
249 0xCC, 0xC9, 0x47, 0x60, 0xA7, 0xD4, 0x62, 0x25, 0x6B, 0xD5, 0x69, 0x16,
250 /* x */
251 0x7D, 0x29, 0x77, 0x81, 0x00, 0xC6, 0x5A, 0x1D, 0xA1, 0x78, 0x37, 0x16,
252 0x58, 0x8D, 0xCE, 0x2B, 0x8B, 0x4A, 0xEE, 0x8E, 0x22, 0x8F, 0x18, 0x96,
253 /* y */
254 0x38, 0xa9, 0x0f, 0x22, 0x63, 0x73, 0x37, 0x33, 0x4b, 0x49, 0xdc, 0xb6,
255 0x6a, 0x6d, 0xc8, 0xf9, 0x97, 0x8a, 0xca, 0x76, 0x48, 0xa9, 0x43, 0xb0,
256 /* order */
257 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
258 0x7A, 0x62, 0xD0, 0x31, 0xC8, 0x3F, 0x42, 0x94, 0xF6, 0x40, 0xEC, 0x13
259 }
260};
261
262static const struct {
263 EC_CURVE_DATA h;
264 unsigned char data[20 + 30 * 6];
265} _EC_X9_62_PRIME_239V1 = {
266 {
267 NID_X9_62_prime_field, 20, 30, 1
268 },
269 {
270 /* seed */
271 0xE4, 0x3B, 0xB4, 0x60, 0xF0, 0xB8, 0x0C, 0xC0, 0xC0, 0xB0, 0x75, 0x79,
272 0x8E, 0x94, 0x80, 0x60, 0xF8, 0x32, 0x1B, 0x7D,
273 /* p */
274 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
275 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
276 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
277 /* a */
278 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
279 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
280 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
281 /* b */
282 0x6B, 0x01, 0x6C, 0x3B, 0xDC, 0xF1, 0x89, 0x41, 0xD0, 0xD6, 0x54, 0x92,
283 0x14, 0x75, 0xCA, 0x71, 0xA9, 0xDB, 0x2F, 0xB2, 0x7D, 0x1D, 0x37, 0x79,
284 0x61, 0x85, 0xC2, 0x94, 0x2C, 0x0A,
285 /* x */
286 0x0F, 0xFA, 0x96, 0x3C, 0xDC, 0xA8, 0x81, 0x6C, 0xCC, 0x33, 0xB8, 0x64,
287 0x2B, 0xED, 0xF9, 0x05, 0xC3, 0xD3, 0x58, 0x57, 0x3D, 0x3F, 0x27, 0xFB,
288 0xBD, 0x3B, 0x3C, 0xB9, 0xAA, 0xAF,
289 /* y */
290 0x7d, 0xeb, 0xe8, 0xe4, 0xe9, 0x0a, 0x5d, 0xae, 0x6e, 0x40, 0x54, 0xca,
291 0x53, 0x0b, 0xa0, 0x46, 0x54, 0xb3, 0x68, 0x18, 0xce, 0x22, 0x6b, 0x39,
292 0xfc, 0xcb, 0x7b, 0x02, 0xf1, 0xae,
293 /* order */
294 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
295 0x7F, 0xFF, 0xFF, 0x9E, 0x5E, 0x9A, 0x9F, 0x5D, 0x90, 0x71, 0xFB, 0xD1,
296 0x52, 0x26, 0x88, 0x90, 0x9D, 0x0B
297 }
298};
299
300static const struct {
301 EC_CURVE_DATA h;
302 unsigned char data[20 + 30 * 6];
303} _EC_X9_62_PRIME_239V2 = {
304 {
305 NID_X9_62_prime_field, 20, 30, 1
306 },
307 {
308 /* seed */
309 0xE8, 0xB4, 0x01, 0x16, 0x04, 0x09, 0x53, 0x03, 0xCA, 0x3B, 0x80, 0x99,
310 0x98, 0x2B, 0xE0, 0x9F, 0xCB, 0x9A, 0xE6, 0x16,
311 /* p */
312 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
313 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
314 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
315 /* a */
316 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
317 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
318 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
319 /* b */
320 0x61, 0x7F, 0xAB, 0x68, 0x32, 0x57, 0x6C, 0xBB, 0xFE, 0xD5, 0x0D, 0x99,
321 0xF0, 0x24, 0x9C, 0x3F, 0xEE, 0x58, 0xB9, 0x4B, 0xA0, 0x03, 0x8C, 0x7A,
322 0xE8, 0x4C, 0x8C, 0x83, 0x2F, 0x2C,
323 /* x */
324 0x38, 0xAF, 0x09, 0xD9, 0x87, 0x27, 0x70, 0x51, 0x20, 0xC9, 0x21, 0xBB,
325 0x5E, 0x9E, 0x26, 0x29, 0x6A, 0x3C, 0xDC, 0xF2, 0xF3, 0x57, 0x57, 0xA0,
326 0xEA, 0xFD, 0x87, 0xB8, 0x30, 0xE7,
327 /* y */
328 0x5b, 0x01, 0x25, 0xe4, 0xdb, 0xea, 0x0e, 0xc7, 0x20, 0x6d, 0xa0, 0xfc,
329 0x01, 0xd9, 0xb0, 0x81, 0x32, 0x9f, 0xb5, 0x55, 0xde, 0x6e, 0xf4, 0x60,
330 0x23, 0x7d, 0xff, 0x8b, 0xe4, 0xba,
331 /* order */
332 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
333 0x80, 0x00, 0x00, 0xCF, 0xA7, 0xE8, 0x59, 0x43, 0x77, 0xD4, 0x14, 0xC0,
334 0x38, 0x21, 0xBC, 0x58, 0x20, 0x63
335 }
336};
337
338static const struct {
339 EC_CURVE_DATA h;
340 unsigned char data[20 + 30 * 6];
341} _EC_X9_62_PRIME_239V3 = {
342 {
343 NID_X9_62_prime_field, 20, 30, 1
344 },
345 {
346 /* seed */
347 0x7D, 0x73, 0x74, 0x16, 0x8F, 0xFE, 0x34, 0x71, 0xB6, 0x0A, 0x85, 0x76,
348 0x86, 0xA1, 0x94, 0x75, 0xD3, 0xBF, 0xA2, 0xFF,
349 /* p */
350 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
351 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
352 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
353 /* a */
354 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
355 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
356 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
357 /* b */
358 0x25, 0x57, 0x05, 0xFA, 0x2A, 0x30, 0x66, 0x54, 0xB1, 0xF4, 0xCB, 0x03,
359 0xD6, 0xA7, 0x50, 0xA3, 0x0C, 0x25, 0x01, 0x02, 0xD4, 0x98, 0x87, 0x17,
360 0xD9, 0xBA, 0x15, 0xAB, 0x6D, 0x3E,
361 /* x */
362 0x67, 0x68, 0xAE, 0x8E, 0x18, 0xBB, 0x92, 0xCF, 0xCF, 0x00, 0x5C, 0x94,
363 0x9A, 0xA2, 0xC6, 0xD9, 0x48, 0x53, 0xD0, 0xE6, 0x60, 0xBB, 0xF8, 0x54,
364 0xB1, 0xC9, 0x50, 0x5F, 0xE9, 0x5A,
365 /* y */
366 0x16, 0x07, 0xe6, 0x89, 0x8f, 0x39, 0x0c, 0x06, 0xbc, 0x1d, 0x55, 0x2b,
367 0xad, 0x22, 0x6f, 0x3b, 0x6f, 0xcf, 0xe4, 0x8b, 0x6e, 0x81, 0x84, 0x99,
368 0xaf, 0x18, 0xe3, 0xed, 0x6c, 0xf3,
369 /* order */
370 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
371 0x7F, 0xFF, 0xFF, 0x97, 0x5D, 0xEB, 0x41, 0xB3, 0xA6, 0x05, 0x7C, 0x3C,
372 0x43, 0x21, 0x46, 0x52, 0x65, 0x51
373 }
374};
375#endif /* FIPS_MODE */
376
377static const struct {
378 EC_CURVE_DATA h;
379 unsigned char data[20 + 32 * 6];
380} _EC_X9_62_PRIME_256V1 = {
381 {
382 NID_X9_62_prime_field, 20, 32, 1
383 },
384 {
385 /* seed */
386 0xC4, 0x9D, 0x36, 0x08, 0x86, 0xE7, 0x04, 0x93, 0x6A, 0x66, 0x78, 0xE1,
387 0x13, 0x9D, 0x26, 0xB7, 0x81, 0x9F, 0x7E, 0x90,
388 /* p */
389 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
390 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
391 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
392 /* a */
393 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
394 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
395 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
396 /* b */
397 0x5A, 0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, 0xE7, 0xB3, 0xEB, 0xBD, 0x55,
398 0x76, 0x98, 0x86, 0xBC, 0x65, 0x1D, 0x06, 0xB0, 0xCC, 0x53, 0xB0, 0xF6,
399 0x3B, 0xCE, 0x3C, 0x3E, 0x27, 0xD2, 0x60, 0x4B,
400 /* x */
401 0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6, 0xE5,
402 0x63, 0xA4, 0x40, 0xF2, 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0,
403 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96,
404 /* y */
405 0x4f, 0xe3, 0x42, 0xe2, 0xfe, 0x1a, 0x7f, 0x9b, 0x8e, 0xe7, 0xeb, 0x4a,
406 0x7c, 0x0f, 0x9e, 0x16, 0x2b, 0xce, 0x33, 0x57, 0x6b, 0x31, 0x5e, 0xce,
407 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51, 0xf5,
408 /* order */
409 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
410 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84,
411 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51
412 }
413};
414
415#ifndef FIPS_MODE
416/* the secg prime curves (minus the nist and x9.62 prime curves) */
417static const struct {
418 EC_CURVE_DATA h;
419 unsigned char data[20 + 14 * 6];
420} _EC_SECG_PRIME_112R1 = {
421 {
422 NID_X9_62_prime_field, 20, 14, 1
423 },
424 {
425 /* seed */
426 0x00, 0xF5, 0x0B, 0x02, 0x8E, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61,
427 0x51, 0x75, 0x29, 0x04, 0x72, 0x78, 0x3F, 0xB1,
428 /* p */
429 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x66, 0x80, 0x76, 0xBE, 0xAD,
430 0x20, 0x8B,
431 /* a */
432 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x66, 0x80, 0x76, 0xBE, 0xAD,
433 0x20, 0x88,
434 /* b */
435 0x65, 0x9E, 0xF8, 0xBA, 0x04, 0x39, 0x16, 0xEE, 0xDE, 0x89, 0x11, 0x70,
436 0x2B, 0x22,
437 /* x */
438 0x09, 0x48, 0x72, 0x39, 0x99, 0x5A, 0x5E, 0xE7, 0x6B, 0x55, 0xF9, 0xC2,
439 0xF0, 0x98,
440 /* y */
441 0xa8, 0x9c, 0xe5, 0xaf, 0x87, 0x24, 0xc0, 0xa2, 0x3e, 0x0e, 0x0f, 0xf7,
442 0x75, 0x00,
443 /* order */
444 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x76, 0x28, 0xDF, 0xAC, 0x65,
445 0x61, 0xC5
446 }
447};
448
449static const struct {
450 EC_CURVE_DATA h;
451 unsigned char data[20 + 14 * 6];
452} _EC_SECG_PRIME_112R2 = {
453 {
454 NID_X9_62_prime_field, 20, 14, 4
455 },
456 {
457 /* seed */
458 0x00, 0x27, 0x57, 0xA1, 0x11, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61,
459 0x51, 0x75, 0x53, 0x16, 0xC0, 0x5E, 0x0B, 0xD4,
460 /* p */
461 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x66, 0x80, 0x76, 0xBE, 0xAD,
462 0x20, 0x8B,
463 /* a */
464 0x61, 0x27, 0xC2, 0x4C, 0x05, 0xF3, 0x8A, 0x0A, 0xAA, 0xF6, 0x5C, 0x0E,
465 0xF0, 0x2C,
466 /* b */
467 0x51, 0xDE, 0xF1, 0x81, 0x5D, 0xB5, 0xED, 0x74, 0xFC, 0xC3, 0x4C, 0x85,
468 0xD7, 0x09,
469 /* x */
470 0x4B, 0xA3, 0x0A, 0xB5, 0xE8, 0x92, 0xB4, 0xE1, 0x64, 0x9D, 0xD0, 0x92,
471 0x86, 0x43,
472 /* y */
473 0xad, 0xcd, 0x46, 0xf5, 0x88, 0x2e, 0x37, 0x47, 0xde, 0xf3, 0x6e, 0x95,
474 0x6e, 0x97,
475 /* order */
476 0x36, 0xDF, 0x0A, 0xAF, 0xD8, 0xB8, 0xD7, 0x59, 0x7C, 0xA1, 0x05, 0x20,
477 0xD0, 0x4B
478 }
479};
480
481static const struct {
482 EC_CURVE_DATA h;
483 unsigned char data[20 + 16 * 6];
484} _EC_SECG_PRIME_128R1 = {
485 {
486 NID_X9_62_prime_field, 20, 16, 1
487 },
488 {
489 /* seed */
490 0x00, 0x0E, 0x0D, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75,
491 0x0C, 0xC0, 0x3A, 0x44, 0x73, 0xD0, 0x36, 0x79,
492 /* p */
493 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
494 0xFF, 0xFF, 0xFF, 0xFF,
495 /* a */
496 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
497 0xFF, 0xFF, 0xFF, 0xFC,
498 /* b */
499 0xE8, 0x75, 0x79, 0xC1, 0x10, 0x79, 0xF4, 0x3D, 0xD8, 0x24, 0x99, 0x3C,
500 0x2C, 0xEE, 0x5E, 0xD3,
501 /* x */
502 0x16, 0x1F, 0xF7, 0x52, 0x8B, 0x89, 0x9B, 0x2D, 0x0C, 0x28, 0x60, 0x7C,
503 0xA5, 0x2C, 0x5B, 0x86,
504 /* y */
505 0xcf, 0x5a, 0xc8, 0x39, 0x5b, 0xaf, 0xeb, 0x13, 0xc0, 0x2d, 0xa2, 0x92,
506 0xdd, 0xed, 0x7a, 0x83,
507 /* order */
508 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x75, 0xA3, 0x0D, 0x1B,
509 0x90, 0x38, 0xA1, 0x15
510 }
511};
512
513static const struct {
514 EC_CURVE_DATA h;
515 unsigned char data[20 + 16 * 6];
516} _EC_SECG_PRIME_128R2 = {
517 {
518 NID_X9_62_prime_field, 20, 16, 4
519 },
520 {
521 /* seed */
522 0x00, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75, 0x12, 0xD8,
523 0xF0, 0x34, 0x31, 0xFC, 0xE6, 0x3B, 0x88, 0xF4,
524 /* p */
525 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
526 0xFF, 0xFF, 0xFF, 0xFF,
527 /* a */
528 0xD6, 0x03, 0x19, 0x98, 0xD1, 0xB3, 0xBB, 0xFE, 0xBF, 0x59, 0xCC, 0x9B,
529 0xBF, 0xF9, 0xAE, 0xE1,
530 /* b */
531 0x5E, 0xEE, 0xFC, 0xA3, 0x80, 0xD0, 0x29, 0x19, 0xDC, 0x2C, 0x65, 0x58,
532 0xBB, 0x6D, 0x8A, 0x5D,
533 /* x */
534 0x7B, 0x6A, 0xA5, 0xD8, 0x5E, 0x57, 0x29, 0x83, 0xE6, 0xFB, 0x32, 0xA7,
535 0xCD, 0xEB, 0xC1, 0x40,
536 /* y */
537 0x27, 0xb6, 0x91, 0x6a, 0x89, 0x4d, 0x3a, 0xee, 0x71, 0x06, 0xfe, 0x80,
538 0x5f, 0xc3, 0x4b, 0x44,
539 /* order */
540 0x3F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xBE, 0x00, 0x24, 0x72,
541 0x06, 0x13, 0xB5, 0xA3
542 }
543};
544
545static const struct {
546 EC_CURVE_DATA h;
547 unsigned char data[0 + 21 * 6];
548} _EC_SECG_PRIME_160K1 = {
549 {
550 NID_X9_62_prime_field, 0, 21, 1
551 },
552 {
553 /* no seed */
554 /* p */
555 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
556 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x73,
557 /* a */
558 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
559 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
560 /* b */
561 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
562 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
563 /* x */
564 0x00, 0x3B, 0x4C, 0x38, 0x2C, 0xE3, 0x7A, 0xA1, 0x92, 0xA4, 0x01, 0x9E,
565 0x76, 0x30, 0x36, 0xF4, 0xF5, 0xDD, 0x4D, 0x7E, 0xBB,
566 /* y */
567 0x00, 0x93, 0x8c, 0xf9, 0x35, 0x31, 0x8f, 0xdc, 0xed, 0x6b, 0xc2, 0x82,
568 0x86, 0x53, 0x17, 0x33, 0xc3, 0xf0, 0x3c, 0x4f, 0xee,
569 /* order */
570 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xB8,
571 0xFA, 0x16, 0xDF, 0xAB, 0x9A, 0xCA, 0x16, 0xB6, 0xB3
572 }
573};
574
575static const struct {
576 EC_CURVE_DATA h;
577 unsigned char data[20 + 21 * 6];
578} _EC_SECG_PRIME_160R1 = {
579 {
580 NID_X9_62_prime_field, 20, 21, 1
581 },
582 {
583 /* seed */
584 0x10, 0x53, 0xCD, 0xE4, 0x2C, 0x14, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
585 0x15, 0x17, 0x53, 0x3B, 0xF3, 0xF8, 0x33, 0x45,
586 /* p */
587 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
588 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF,
589 /* a */
590 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
591 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFC,
592 /* b */
593 0x00, 0x1C, 0x97, 0xBE, 0xFC, 0x54, 0xBD, 0x7A, 0x8B, 0x65, 0xAC, 0xF8,
594 0x9F, 0x81, 0xD4, 0xD4, 0xAD, 0xC5, 0x65, 0xFA, 0x45,
595 /* x */
596 0x00, 0x4A, 0x96, 0xB5, 0x68, 0x8E, 0xF5, 0x73, 0x28, 0x46, 0x64, 0x69,
597 0x89, 0x68, 0xC3, 0x8B, 0xB9, 0x13, 0xCB, 0xFC, 0x82,
598 /* y */
599 0x00, 0x23, 0xa6, 0x28, 0x55, 0x31, 0x68, 0x94, 0x7d, 0x59, 0xdc, 0xc9,
600 0x12, 0x04, 0x23, 0x51, 0x37, 0x7a, 0xc5, 0xfb, 0x32,
601 /* order */
602 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF4,
603 0xC8, 0xF9, 0x27, 0xAE, 0xD3, 0xCA, 0x75, 0x22, 0x57
604 }
605};
606
607static const struct {
608 EC_CURVE_DATA h;
609 unsigned char data[20 + 21 * 6];
610} _EC_SECG_PRIME_160R2 = {
611 {
612 NID_X9_62_prime_field, 20, 21, 1
613 },
614 {
615 /* seed */
616 0xB9, 0x9B, 0x99, 0xB0, 0x99, 0xB3, 0x23, 0xE0, 0x27, 0x09, 0xA4, 0xD6,
617 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x51,
618 /* p */
619 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
620 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x73,
621 /* a */
622 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
623 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x70,
624 /* b */
625 0x00, 0xB4, 0xE1, 0x34, 0xD3, 0xFB, 0x59, 0xEB, 0x8B, 0xAB, 0x57, 0x27,
626 0x49, 0x04, 0x66, 0x4D, 0x5A, 0xF5, 0x03, 0x88, 0xBA,
627 /* x */
628 0x00, 0x52, 0xDC, 0xB0, 0x34, 0x29, 0x3A, 0x11, 0x7E, 0x1F, 0x4F, 0xF1,
629 0x1B, 0x30, 0xF7, 0x19, 0x9D, 0x31, 0x44, 0xCE, 0x6D,
630 /* y */
631 0x00, 0xfe, 0xaf, 0xfe, 0xf2, 0xe3, 0x31, 0xf2, 0x96, 0xe0, 0x71, 0xfa,
632 0x0d, 0xf9, 0x98, 0x2c, 0xfe, 0xa7, 0xd4, 0x3f, 0x2e,
633 /* order */
634 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35,
635 0x1E, 0xE7, 0x86, 0xA8, 0x18, 0xF3, 0xA1, 0xA1, 0x6B
636 }
637};
638
639static const struct {
640 EC_CURVE_DATA h;
641 unsigned char data[0 + 24 * 6];
642} _EC_SECG_PRIME_192K1 = {
643 {
644 NID_X9_62_prime_field, 0, 24, 1
645 },
646 {
647 /* no seed */
648 /* p */
649 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
650 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0x37,
651 /* a */
652 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
653 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
654 /* b */
655 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
656 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
657 /* x */
658 0xDB, 0x4F, 0xF1, 0x0E, 0xC0, 0x57, 0xE9, 0xAE, 0x26, 0xB0, 0x7D, 0x02,
659 0x80, 0xB7, 0xF4, 0x34, 0x1D, 0xA5, 0xD1, 0xB1, 0xEA, 0xE0, 0x6C, 0x7D,
660 /* y */
661 0x9b, 0x2f, 0x2f, 0x6d, 0x9c, 0x56, 0x28, 0xa7, 0x84, 0x41, 0x63, 0xd0,
662 0x15, 0xbe, 0x86, 0x34, 0x40, 0x82, 0xaa, 0x88, 0xd9, 0x5e, 0x2f, 0x9d,
663 /* order */
664 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
665 0x26, 0xF2, 0xFC, 0x17, 0x0F, 0x69, 0x46, 0x6A, 0x74, 0xDE, 0xFD, 0x8D
666 }
667};
668
669static const struct {
670 EC_CURVE_DATA h;
671 unsigned char data[0 + 29 * 6];
672} _EC_SECG_PRIME_224K1 = {
673 {
674 NID_X9_62_prime_field, 0, 29, 1
675 },
676 {
677 /* no seed */
678 /* p */
679 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
680 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
681 0xFE, 0xFF, 0xFF, 0xE5, 0x6D,
682 /* a */
683 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
684 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
685 0x00, 0x00, 0x00, 0x00, 0x00,
686 /* b */
687 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
688 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
689 0x00, 0x00, 0x00, 0x00, 0x05,
690 /* x */
691 0x00, 0xA1, 0x45, 0x5B, 0x33, 0x4D, 0xF0, 0x99, 0xDF, 0x30, 0xFC, 0x28,
692 0xA1, 0x69, 0xA4, 0x67, 0xE9, 0xE4, 0x70, 0x75, 0xA9, 0x0F, 0x7E, 0x65,
693 0x0E, 0xB6, 0xB7, 0xA4, 0x5C,
694 /* y */
695 0x00, 0x7e, 0x08, 0x9f, 0xed, 0x7f, 0xba, 0x34, 0x42, 0x82, 0xca, 0xfb,
696 0xd6, 0xf7, 0xe3, 0x19, 0xf7, 0xc0, 0xb0, 0xbd, 0x59, 0xe2, 0xca, 0x4b,
697 0xdb, 0x55, 0x6d, 0x61, 0xa5,
698 /* order */
699 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
700 0x00, 0x00, 0x01, 0xDC, 0xE8, 0xD2, 0xEC, 0x61, 0x84, 0xCA, 0xF0, 0xA9,
701 0x71, 0x76, 0x9F, 0xB1, 0xF7
702 }
703};
704
705static const struct {
706 EC_CURVE_DATA h;
707 unsigned char data[0 + 32 * 6];
708} _EC_SECG_PRIME_256K1 = {
709 {
710 NID_X9_62_prime_field, 0, 32, 1
711 },
712 {
713 /* no seed */
714 /* p */
715 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
716 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
717 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFC, 0x2F,
718 /* a */
719 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
720 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
721 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
722 /* b */
723 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
724 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
725 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
726 /* x */
727 0x79, 0xBE, 0x66, 0x7E, 0xF9, 0xDC, 0xBB, 0xAC, 0x55, 0xA0, 0x62, 0x95,
728 0xCE, 0x87, 0x0B, 0x07, 0x02, 0x9B, 0xFC, 0xDB, 0x2D, 0xCE, 0x28, 0xD9,
729 0x59, 0xF2, 0x81, 0x5B, 0x16, 0xF8, 0x17, 0x98,
730 /* y */
731 0x48, 0x3a, 0xda, 0x77, 0x26, 0xa3, 0xc4, 0x65, 0x5d, 0xa4, 0xfb, 0xfc,
732 0x0e, 0x11, 0x08, 0xa8, 0xfd, 0x17, 0xb4, 0x48, 0xa6, 0x85, 0x54, 0x19,
733 0x9c, 0x47, 0xd0, 0x8f, 0xfb, 0x10, 0xd4, 0xb8,
734 /* order */
735 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
736 0xFF, 0xFF, 0xFF, 0xFE, 0xBA, 0xAE, 0xDC, 0xE6, 0xAF, 0x48, 0xA0, 0x3B,
737 0xBF, 0xD2, 0x5E, 0x8C, 0xD0, 0x36, 0x41, 0x41
738 }
739};
740
741/* some wap/wtls curves */
742static const struct {
743 EC_CURVE_DATA h;
744 unsigned char data[0 + 15 * 6];
745} _EC_WTLS_8 = {
746 {
747 NID_X9_62_prime_field, 0, 15, 1
748 },
749 {
750 /* no seed */
751 /* p */
752 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
753 0xFF, 0xFD, 0xE7,
754 /* a */
755 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
756 0x00, 0x00, 0x00,
757 /* b */
758 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
759 0x00, 0x00, 0x03,
760 /* x */
761 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
762 0x00, 0x00, 0x01,
763 /* y */
764 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
765 0x00, 0x00, 0x02,
766 /* order */
767 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xEC, 0xEA, 0x55, 0x1A,
768 0xD8, 0x37, 0xE9
769 }
770};
771
772static const struct {
773 EC_CURVE_DATA h;
774 unsigned char data[0 + 21 * 6];
775} _EC_WTLS_9 = {
776 {
777 NID_X9_62_prime_field, 0, 21, 1
778 },
779 {
780 /* no seed */
781 /* p */
782 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
783 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x80, 0x8F,
784 /* a */
785 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
786 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
787 /* b */
788 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
789 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
790 /* x */
791 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
792 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
793 /* y */
794 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
795 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
796 /* order */
797 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xCD,
798 0xC9, 0x8A, 0xE0, 0xE2, 0xDE, 0x57, 0x4A, 0xBF, 0x33
799 }
800};
801
802static const struct {
803 EC_CURVE_DATA h;
804 unsigned char data[0 + 28 * 6];
805} _EC_WTLS_12 = {
806 {
807 NID_X9_62_prime_field, 0, 28, 1
808 },
809 {
810 /* no seed */
811 /* p */
812 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
813 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
814 0x00, 0x00, 0x00, 0x01,
815 /* a */
816 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
817 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
818 0xFF, 0xFF, 0xFF, 0xFE,
819 /* b */
820 0xB4, 0x05, 0x0A, 0x85, 0x0C, 0x04, 0xB3, 0xAB, 0xF5, 0x41, 0x32, 0x56,
821 0x50, 0x44, 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA, 0x27, 0x0B, 0x39, 0x43,
822 0x23, 0x55, 0xFF, 0xB4,
823 /* x */
824 0xB7, 0x0E, 0x0C, 0xBD, 0x6B, 0xB4, 0xBF, 0x7F, 0x32, 0x13, 0x90, 0xB9,
825 0x4A, 0x03, 0xC1, 0xD3, 0x56, 0xC2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xD6,
826 0x11, 0x5C, 0x1D, 0x21,
827 /* y */
828 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb, 0x4c, 0x22, 0xdf, 0xe6,
829 0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99,
830 0x85, 0x00, 0x7e, 0x34,
831 /* order */
832 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
833 0xFF, 0xFF, 0x16, 0xA2, 0xE0, 0xB8, 0xF0, 0x3E, 0x13, 0xDD, 0x29, 0x45,
834 0x5C, 0x5C, 0x2A, 0x3D
835 }
836};
837#endif /* FIPS_MODE */
838
839#ifndef OPENSSL_NO_EC2M
840
841/* characteristic two curves */
842
843# ifndef FIPS_MODE
844static const struct {
845 EC_CURVE_DATA h;
846 unsigned char data[20 + 15 * 6];
847} _EC_SECG_CHAR2_113R1 = {
848 {
849 NID_X9_62_characteristic_two_field, 20, 15, 2
850 },
851 {
852 /* seed */
853 0x10, 0xE7, 0x23, 0xAB, 0x14, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15,
854 0x17, 0x56, 0xFE, 0xBF, 0x8F, 0xCB, 0x49, 0xA9,
855 /* p */
856 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
857 0x00, 0x02, 0x01,
858 /* a */
859 0x00, 0x30, 0x88, 0x25, 0x0C, 0xA6, 0xE7, 0xC7, 0xFE, 0x64, 0x9C, 0xE8,
860 0x58, 0x20, 0xF7,
861 /* b */
862 0x00, 0xE8, 0xBE, 0xE4, 0xD3, 0xE2, 0x26, 0x07, 0x44, 0x18, 0x8B, 0xE0,
863 0xE9, 0xC7, 0x23,
864 /* x */
865 0x00, 0x9D, 0x73, 0x61, 0x6F, 0x35, 0xF4, 0xAB, 0x14, 0x07, 0xD7, 0x35,
866 0x62, 0xC1, 0x0F,
867 /* y */
868 0x00, 0xA5, 0x28, 0x30, 0x27, 0x79, 0x58, 0xEE, 0x84, 0xD1, 0x31, 0x5E,
869 0xD3, 0x18, 0x86,
870 /* order */
871 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD9, 0xCC, 0xEC, 0x8A,
872 0x39, 0xE5, 0x6F
873 }
874};
875
876static const struct {
877 EC_CURVE_DATA h;
878 unsigned char data[20 + 15 * 6];
879} _EC_SECG_CHAR2_113R2 = {
880 {
881 NID_X9_62_characteristic_two_field, 20, 15, 2
882 },
883 {
884 /* seed */
885 0x10, 0xC0, 0xFB, 0x15, 0x76, 0x08, 0x60, 0xDE, 0xF1, 0xEE, 0xF4, 0xD6,
886 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x5D,
887 /* p */
888 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
889 0x00, 0x02, 0x01,
890 /* a */
891 0x00, 0x68, 0x99, 0x18, 0xDB, 0xEC, 0x7E, 0x5A, 0x0D, 0xD6, 0xDF, 0xC0,
892 0xAA, 0x55, 0xC7,
893 /* b */
894 0x00, 0x95, 0xE9, 0xA9, 0xEC, 0x9B, 0x29, 0x7B, 0xD4, 0xBF, 0x36, 0xE0,
895 0x59, 0x18, 0x4F,
896 /* x */
897 0x01, 0xA5, 0x7A, 0x6A, 0x7B, 0x26, 0xCA, 0x5E, 0xF5, 0x2F, 0xCD, 0xB8,
898 0x16, 0x47, 0x97,
899 /* y */
900 0x00, 0xB3, 0xAD, 0xC9, 0x4E, 0xD1, 0xFE, 0x67, 0x4C, 0x06, 0xE6, 0x95,
901 0xBA, 0xBA, 0x1D,
902 /* order */
903 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x78, 0x9B, 0x24,
904 0x96, 0xAF, 0x93
905 }
906};
907
908static const struct {
909 EC_CURVE_DATA h;
910 unsigned char data[20 + 17 * 6];
911} _EC_SECG_CHAR2_131R1 = {
912 {
913 NID_X9_62_characteristic_two_field, 20, 17, 2
914 },
915 {
916 /* seed */
917 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75, 0x98, 0x5B, 0xD3,
918 0xAD, 0xBA, 0xDA, 0x21, 0xB4, 0x3A, 0x97, 0xE2,
919 /* p */
920 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
921 0x00, 0x00, 0x00, 0x01, 0x0D,
922 /* a */
923 0x07, 0xA1, 0x1B, 0x09, 0xA7, 0x6B, 0x56, 0x21, 0x44, 0x41, 0x8F, 0xF3,
924 0xFF, 0x8C, 0x25, 0x70, 0xB8,
925 /* b */
926 0x02, 0x17, 0xC0, 0x56, 0x10, 0x88, 0x4B, 0x63, 0xB9, 0xC6, 0xC7, 0x29,
927 0x16, 0x78, 0xF9, 0xD3, 0x41,
928 /* x */
929 0x00, 0x81, 0xBA, 0xF9, 0x1F, 0xDF, 0x98, 0x33, 0xC4, 0x0F, 0x9C, 0x18,
930 0x13, 0x43, 0x63, 0x83, 0x99,
931 /* y */
932 0x07, 0x8C, 0x6E, 0x7E, 0xA3, 0x8C, 0x00, 0x1F, 0x73, 0xC8, 0x13, 0x4B,
933 0x1B, 0x4E, 0xF9, 0xE1, 0x50,
934 /* order */
935 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x31, 0x23, 0x95,
936 0x3A, 0x94, 0x64, 0xB5, 0x4D
937 }
938};
939
940static const struct {
941 EC_CURVE_DATA h;
942 unsigned char data[20 + 17 * 6];
943} _EC_SECG_CHAR2_131R2 = {
944 {
945 NID_X9_62_characteristic_two_field, 20, 17, 2
946 },
947 {
948 /* seed */
949 0x98, 0x5B, 0xD3, 0xAD, 0xBA, 0xD4, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
950 0x15, 0x17, 0x5A, 0x21, 0xB4, 0x3A, 0x97, 0xE3,
951 /* p */
952 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
953 0x00, 0x00, 0x00, 0x01, 0x0D,
954 /* a */
955 0x03, 0xE5, 0xA8, 0x89, 0x19, 0xD7, 0xCA, 0xFC, 0xBF, 0x41, 0x5F, 0x07,
956 0xC2, 0x17, 0x65, 0x73, 0xB2,
957 /* b */
958 0x04, 0xB8, 0x26, 0x6A, 0x46, 0xC5, 0x56, 0x57, 0xAC, 0x73, 0x4C, 0xE3,
959 0x8F, 0x01, 0x8F, 0x21, 0x92,
960 /* x */
961 0x03, 0x56, 0xDC, 0xD8, 0xF2, 0xF9, 0x50, 0x31, 0xAD, 0x65, 0x2D, 0x23,
962 0x95, 0x1B, 0xB3, 0x66, 0xA8,
963 /* y */
964 0x06, 0x48, 0xF0, 0x6D, 0x86, 0x79, 0x40, 0xA5, 0x36, 0x6D, 0x9E, 0x26,
965 0x5D, 0xE9, 0xEB, 0x24, 0x0F,
966 /* order */
967 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x69, 0x54, 0xA2,
968 0x33, 0x04, 0x9B, 0xA9, 0x8F
969 }
970};
971# endif /* FIPS_MODE */
972
973static const struct {
974 EC_CURVE_DATA h;
975 unsigned char data[0 + 21 * 6];
976} _EC_NIST_CHAR2_163K = {
977 {
978 NID_X9_62_characteristic_two_field, 0, 21, 2
979 },
980 {
981 /* no seed */
982 /* p */
983 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
984 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC9,
985 /* a */
986 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
987 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
988 /* b */
989 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
990 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
991 /* x */
992 0x02, 0xFE, 0x13, 0xC0, 0x53, 0x7B, 0xBC, 0x11, 0xAC, 0xAA, 0x07, 0xD7,
993 0x93, 0xDE, 0x4E, 0x6D, 0x5E, 0x5C, 0x94, 0xEE, 0xE8,
994 /* y */
995 0x02, 0x89, 0x07, 0x0F, 0xB0, 0x5D, 0x38, 0xFF, 0x58, 0x32, 0x1F, 0x2E,
996 0x80, 0x05, 0x36, 0xD5, 0x38, 0xCC, 0xDA, 0xA3, 0xD9,
997 /* order */
998 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
999 0x08, 0xA2, 0xE0, 0xCC, 0x0D, 0x99, 0xF8, 0xA5, 0xEF
1000 }
1001};
1002
1003# ifndef FIPS_MODE
1004static const struct {
1005 EC_CURVE_DATA h;
1006 unsigned char data[0 + 21 * 6];
1007} _EC_SECG_CHAR2_163R1 = {
1008 {
1009 NID_X9_62_characteristic_two_field, 0, 21, 2
1010 },
1011 {
1012 /* p */
1013 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1014 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC9,
1015 /* a */
1016 0x07, 0xB6, 0x88, 0x2C, 0xAA, 0xEF, 0xA8, 0x4F, 0x95, 0x54, 0xFF, 0x84,
1017 0x28, 0xBD, 0x88, 0xE2, 0x46, 0xD2, 0x78, 0x2A, 0xE2,
1018 /* b */
1019 0x07, 0x13, 0x61, 0x2D, 0xCD, 0xDC, 0xB4, 0x0A, 0xAB, 0x94, 0x6B, 0xDA,
1020 0x29, 0xCA, 0x91, 0xF7, 0x3A, 0xF9, 0x58, 0xAF, 0xD9,
1021 /* x */
1022 0x03, 0x69, 0x97, 0x96, 0x97, 0xAB, 0x43, 0x89, 0x77, 0x89, 0x56, 0x67,
1023 0x89, 0x56, 0x7F, 0x78, 0x7A, 0x78, 0x76, 0xA6, 0x54,
1024 /* y */
1025 0x00, 0x43, 0x5E, 0xDB, 0x42, 0xEF, 0xAF, 0xB2, 0x98, 0x9D, 0x51, 0xFE,
1026 0xFC, 0xE3, 0xC8, 0x09, 0x88, 0xF4, 0x1F, 0xF8, 0x83,
1027 /* order */
1028 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x48,
1029 0xAA, 0xB6, 0x89, 0xC2, 0x9C, 0xA7, 0x10, 0x27, 0x9B
1030 }
1031};
1032# endif /* FIPS_MODE */
1033
1034static const struct {
1035 EC_CURVE_DATA h;
1036 unsigned char data[0 + 21 * 6];
1037} _EC_NIST_CHAR2_163B = {
1038 {
1039 NID_X9_62_characteristic_two_field, 0, 21, 2
1040 },
1041 {
1042 /* p */
1043 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1044 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC9,
1045 /* a */
1046 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1047 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1048 /* b */
1049 0x02, 0x0A, 0x60, 0x19, 0x07, 0xB8, 0xC9, 0x53, 0xCA, 0x14, 0x81, 0xEB,
1050 0x10, 0x51, 0x2F, 0x78, 0x74, 0x4A, 0x32, 0x05, 0xFD,
1051 /* x */
1052 0x03, 0xF0, 0xEB, 0xA1, 0x62, 0x86, 0xA2, 0xD5, 0x7E, 0xA0, 0x99, 0x11,
1053 0x68, 0xD4, 0x99, 0x46, 0x37, 0xE8, 0x34, 0x3E, 0x36,
1054 /* y */
1055 0x00, 0xD5, 0x1F, 0xBC, 0x6C, 0x71, 0xA0, 0x09, 0x4F, 0xA2, 0xCD, 0xD5,
1056 0x45, 0xB1, 0x1C, 0x5C, 0x0C, 0x79, 0x73, 0x24, 0xF1,
1057 /* order */
1058 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x92,
1059 0xFE, 0x77, 0xE7, 0x0C, 0x12, 0xA4, 0x23, 0x4C, 0x33
1060 }
1061};
1062
1063# ifndef FIPS_MODE
1064static const struct {
1065 EC_CURVE_DATA h;
1066 unsigned char data[20 + 25 * 6];
1067} _EC_SECG_CHAR2_193R1 = {
1068 {
1069 NID_X9_62_characteristic_two_field, 20, 25, 2
1070 },
1071 {
1072 /* seed */
1073 0x10, 0x3F, 0xAE, 0xC7, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51,
1074 0x75, 0x77, 0x7F, 0xC5, 0xB1, 0x91, 0xEF, 0x30,
1075 /* p */
1076 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1077 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
1078 0x01,
1079 /* a */
1080 0x00, 0x17, 0x85, 0x8F, 0xEB, 0x7A, 0x98, 0x97, 0x51, 0x69, 0xE1, 0x71,
1081 0xF7, 0x7B, 0x40, 0x87, 0xDE, 0x09, 0x8A, 0xC8, 0xA9, 0x11, 0xDF, 0x7B,
1082 0x01,
1083 /* b */
1084 0x00, 0xFD, 0xFB, 0x49, 0xBF, 0xE6, 0xC3, 0xA8, 0x9F, 0xAC, 0xAD, 0xAA,
1085 0x7A, 0x1E, 0x5B, 0xBC, 0x7C, 0xC1, 0xC2, 0xE5, 0xD8, 0x31, 0x47, 0x88,
1086 0x14,
1087 /* x */
1088 0x01, 0xF4, 0x81, 0xBC, 0x5F, 0x0F, 0xF8, 0x4A, 0x74, 0xAD, 0x6C, 0xDF,
1089 0x6F, 0xDE, 0xF4, 0xBF, 0x61, 0x79, 0x62, 0x53, 0x72, 0xD8, 0xC0, 0xC5,
1090 0xE1,
1091 /* y */
1092 0x00, 0x25, 0xE3, 0x99, 0xF2, 0x90, 0x37, 0x12, 0xCC, 0xF3, 0xEA, 0x9E,
1093 0x3A, 0x1A, 0xD1, 0x7F, 0xB0, 0xB3, 0x20, 0x1B, 0x6A, 0xF7, 0xCE, 0x1B,
1094 0x05,
1095 /* order */
1096 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1097 0x00, 0xC7, 0xF3, 0x4A, 0x77, 0x8F, 0x44, 0x3A, 0xCC, 0x92, 0x0E, 0xBA,
1098 0x49
1099 }
1100};
1101
1102static const struct {
1103 EC_CURVE_DATA h;
1104 unsigned char data[20 + 25 * 6];
1105} _EC_SECG_CHAR2_193R2 = {
1106 {
1107 NID_X9_62_characteristic_two_field, 20, 25, 2
1108 },
1109 {
1110 /* seed */
1111 0x10, 0xB7, 0xB4, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x51,
1112 0x37, 0xC8, 0xA1, 0x6F, 0xD0, 0xDA, 0x22, 0x11,
1113 /* p */
1114 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1115 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
1116 0x01,
1117 /* a */
1118 0x01, 0x63, 0xF3, 0x5A, 0x51, 0x37, 0xC2, 0xCE, 0x3E, 0xA6, 0xED, 0x86,
1119 0x67, 0x19, 0x0B, 0x0B, 0xC4, 0x3E, 0xCD, 0x69, 0x97, 0x77, 0x02, 0x70,
1120 0x9B,
1121 /* b */
1122 0x00, 0xC9, 0xBB, 0x9E, 0x89, 0x27, 0xD4, 0xD6, 0x4C, 0x37, 0x7E, 0x2A,
1123 0xB2, 0x85, 0x6A, 0x5B, 0x16, 0xE3, 0xEF, 0xB7, 0xF6, 0x1D, 0x43, 0x16,
1124 0xAE,
1125 /* x */
1126 0x00, 0xD9, 0xB6, 0x7D, 0x19, 0x2E, 0x03, 0x67, 0xC8, 0x03, 0xF3, 0x9E,
1127 0x1A, 0x7E, 0x82, 0xCA, 0x14, 0xA6, 0x51, 0x35, 0x0A, 0xAE, 0x61, 0x7E,
1128 0x8F,
1129 /* y */
1130 0x01, 0xCE, 0x94, 0x33, 0x56, 0x07, 0xC3, 0x04, 0xAC, 0x29, 0xE7, 0xDE,
1131 0xFB, 0xD9, 0xCA, 0x01, 0xF5, 0x96, 0xF9, 0x27, 0x22, 0x4C, 0xDE, 0xCF,
1132 0x6C,
1133 /* order */
1134 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1135 0x01, 0x5A, 0xAB, 0x56, 0x1B, 0x00, 0x54, 0x13, 0xCC, 0xD4, 0xEE, 0x99,
1136 0xD5
1137 }
1138};
1139# endif /* FIPS_MODE */
1140
1141static const struct {
1142 EC_CURVE_DATA h;
1143 unsigned char data[0 + 30 * 6];
1144} _EC_NIST_CHAR2_233K = {
1145 {
1146 NID_X9_62_characteristic_two_field, 0, 30, 4
1147 },
1148 {
1149 /* no seed */
1150 /* p */
1151 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1152 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
1153 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1154 /* a */
1155 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1156 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1157 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1158 /* b */
1159 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1160 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1161 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1162 /* x */
1163 0x01, 0x72, 0x32, 0xBA, 0x85, 0x3A, 0x7E, 0x73, 0x1A, 0xF1, 0x29, 0xF2,
1164 0x2F, 0xF4, 0x14, 0x95, 0x63, 0xA4, 0x19, 0xC2, 0x6B, 0xF5, 0x0A, 0x4C,
1165 0x9D, 0x6E, 0xEF, 0xAD, 0x61, 0x26,
1166 /* y */
1167 0x01, 0xDB, 0x53, 0x7D, 0xEC, 0xE8, 0x19, 0xB7, 0xF7, 0x0F, 0x55, 0x5A,
1168 0x67, 0xC4, 0x27, 0xA8, 0xCD, 0x9B, 0xF1, 0x8A, 0xEB, 0x9B, 0x56, 0xE0,
1169 0xC1, 0x10, 0x56, 0xFA, 0xE6, 0xA3,
1170 /* order */
1171 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1172 0x00, 0x00, 0x00, 0x06, 0x9D, 0x5B, 0xB9, 0x15, 0xBC, 0xD4, 0x6E, 0xFB,
1173 0x1A, 0xD5, 0xF1, 0x73, 0xAB, 0xDF
1174 }
1175};
1176
1177static const struct {
1178 EC_CURVE_DATA h;
1179 unsigned char data[20 + 30 * 6];
1180} _EC_NIST_CHAR2_233B = {
1181 {
1182 NID_X9_62_characteristic_two_field, 20, 30, 2
1183 },
1184 {
1185 /* seed */
1186 0x74, 0xD5, 0x9F, 0xF0, 0x7F, 0x6B, 0x41, 0x3D, 0x0E, 0xA1, 0x4B, 0x34,
1187 0x4B, 0x20, 0xA2, 0xDB, 0x04, 0x9B, 0x50, 0xC3,
1188 /* p */
1189 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1190 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
1191 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1192 /* a */
1193 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1194 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1195 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1196 /* b */
1197 0x00, 0x66, 0x64, 0x7E, 0xDE, 0x6C, 0x33, 0x2C, 0x7F, 0x8C, 0x09, 0x23,
1198 0xBB, 0x58, 0x21, 0x3B, 0x33, 0x3B, 0x20, 0xE9, 0xCE, 0x42, 0x81, 0xFE,
1199 0x11, 0x5F, 0x7D, 0x8F, 0x90, 0xAD,
1200 /* x */
1201 0x00, 0xFA, 0xC9, 0xDF, 0xCB, 0xAC, 0x83, 0x13, 0xBB, 0x21, 0x39, 0xF1,
1202 0xBB, 0x75, 0x5F, 0xEF, 0x65, 0xBC, 0x39, 0x1F, 0x8B, 0x36, 0xF8, 0xF8,
1203 0xEB, 0x73, 0x71, 0xFD, 0x55, 0x8B,
1204 /* y */
1205 0x01, 0x00, 0x6A, 0x08, 0xA4, 0x19, 0x03, 0x35, 0x06, 0x78, 0xE5, 0x85,
1206 0x28, 0xBE, 0xBF, 0x8A, 0x0B, 0xEF, 0xF8, 0x67, 0xA7, 0xCA, 0x36, 0x71,
1207 0x6F, 0x7E, 0x01, 0xF8, 0x10, 0x52,
1208 /* order */
1209 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1210 0x00, 0x00, 0x00, 0x13, 0xE9, 0x74, 0xE7, 0x2F, 0x8A, 0x69, 0x22, 0x03,
1211 0x1D, 0x26, 0x03, 0xCF, 0xE0, 0xD7
1212 }
1213};
1214
1215#ifndef FIPS_MODE
1216static const struct {
1217 EC_CURVE_DATA h;
1218 unsigned char data[0 + 30 * 6];
1219} _EC_SECG_CHAR2_239K1 = {
1220 {
1221 NID_X9_62_characteristic_two_field, 0, 30, 4
1222 },
1223 {
1224 /* no seed */
1225 /* p */
1226 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
1227 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1228 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1229 /* a */
1230 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1231 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1232 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1233 /* b */
1234 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1235 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1236 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1237 /* x */
1238 0x29, 0xA0, 0xB6, 0xA8, 0x87, 0xA9, 0x83, 0xE9, 0x73, 0x09, 0x88, 0xA6,
1239 0x87, 0x27, 0xA8, 0xB2, 0xD1, 0x26, 0xC4, 0x4C, 0xC2, 0xCC, 0x7B, 0x2A,
1240 0x65, 0x55, 0x19, 0x30, 0x35, 0xDC,
1241 /* y */
1242 0x76, 0x31, 0x08, 0x04, 0xF1, 0x2E, 0x54, 0x9B, 0xDB, 0x01, 0x1C, 0x10,
1243 0x30, 0x89, 0xE7, 0x35, 0x10, 0xAC, 0xB2, 0x75, 0xFC, 0x31, 0x2A, 0x5D,
1244 0xC6, 0xB7, 0x65, 0x53, 0xF0, 0xCA,
1245 /* order */
1246 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1247 0x00, 0x00, 0x00, 0x5A, 0x79, 0xFE, 0xC6, 0x7C, 0xB6, 0xE9, 0x1F, 0x1C,
1248 0x1D, 0xA8, 0x00, 0xE4, 0x78, 0xA5
1249 }
1250};
1251# endif /* FIPS_MODE */
1252
1253static const struct {
1254 EC_CURVE_DATA h;
1255 unsigned char data[0 + 36 * 6];
1256} _EC_NIST_CHAR2_283K = {
1257 {
1258 NID_X9_62_characteristic_two_field, 0, 36, 4
1259 },
1260 {
1261 /* no seed */
1262 /* p */
1263 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1264 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1265 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xA1,
1266 /* a */
1267 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1268 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1269 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1270 /* b */
1271 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1272 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1273 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1274 /* x */
1275 0x05, 0x03, 0x21, 0x3F, 0x78, 0xCA, 0x44, 0x88, 0x3F, 0x1A, 0x3B, 0x81,
1276 0x62, 0xF1, 0x88, 0xE5, 0x53, 0xCD, 0x26, 0x5F, 0x23, 0xC1, 0x56, 0x7A,
1277 0x16, 0x87, 0x69, 0x13, 0xB0, 0xC2, 0xAC, 0x24, 0x58, 0x49, 0x28, 0x36,
1278 /* y */
1279 0x01, 0xCC, 0xDA, 0x38, 0x0F, 0x1C, 0x9E, 0x31, 0x8D, 0x90, 0xF9, 0x5D,
1280 0x07, 0xE5, 0x42, 0x6F, 0xE8, 0x7E, 0x45, 0xC0, 0xE8, 0x18, 0x46, 0x98,
1281 0xE4, 0x59, 0x62, 0x36, 0x4E, 0x34, 0x11, 0x61, 0x77, 0xDD, 0x22, 0x59,
1282 /* order */
1283 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
1284 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE9, 0xAE, 0x2E, 0xD0, 0x75, 0x77,
1285 0x26, 0x5D, 0xFF, 0x7F, 0x94, 0x45, 0x1E, 0x06, 0x1E, 0x16, 0x3C, 0x61
1286 }
1287};
1288
1289static const struct {
1290 EC_CURVE_DATA h;
1291 unsigned char data[20 + 36 * 6];
1292} _EC_NIST_CHAR2_283B = {
1293 {
1294 NID_X9_62_characteristic_two_field, 20, 36, 2
1295 },
1296 {
1297 /* seed */
1298 0x77, 0xE2, 0xB0, 0x73, 0x70, 0xEB, 0x0F, 0x83, 0x2A, 0x6D, 0xD5, 0xB6,
1299 0x2D, 0xFC, 0x88, 0xCD, 0x06, 0xBB, 0x84, 0xBE,
1300 /* p */
1301 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1302 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1303 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xA1,
1304 /* a */
1305 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1306 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1307 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1308 /* b */
1309 0x02, 0x7B, 0x68, 0x0A, 0xC8, 0xB8, 0x59, 0x6D, 0xA5, 0xA4, 0xAF, 0x8A,
1310 0x19, 0xA0, 0x30, 0x3F, 0xCA, 0x97, 0xFD, 0x76, 0x45, 0x30, 0x9F, 0xA2,
1311 0xA5, 0x81, 0x48, 0x5A, 0xF6, 0x26, 0x3E, 0x31, 0x3B, 0x79, 0xA2, 0xF5,
1312 /* x */
1313 0x05, 0xF9, 0x39, 0x25, 0x8D, 0xB7, 0xDD, 0x90, 0xE1, 0x93, 0x4F, 0x8C,
1314 0x70, 0xB0, 0xDF, 0xEC, 0x2E, 0xED, 0x25, 0xB8, 0x55, 0x7E, 0xAC, 0x9C,
1315 0x80, 0xE2, 0xE1, 0x98, 0xF8, 0xCD, 0xBE, 0xCD, 0x86, 0xB1, 0x20, 0x53,
1316 /* y */
1317 0x03, 0x67, 0x68, 0x54, 0xFE, 0x24, 0x14, 0x1C, 0xB9, 0x8F, 0xE6, 0xD4,
1318 0xB2, 0x0D, 0x02, 0xB4, 0x51, 0x6F, 0xF7, 0x02, 0x35, 0x0E, 0xDD, 0xB0,
1319 0x82, 0x67, 0x79, 0xC8, 0x13, 0xF0, 0xDF, 0x45, 0xBE, 0x81, 0x12, 0xF4,
1320 /* order */
1321 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
1322 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0x90, 0x39, 0x96, 0x60, 0xFC,
1323 0x93, 0x8A, 0x90, 0x16, 0x5B, 0x04, 0x2A, 0x7C, 0xEF, 0xAD, 0xB3, 0x07
1324 }
1325};
1326
1327static const struct {
1328 EC_CURVE_DATA h;
1329 unsigned char data[0 + 52 * 6];
1330} _EC_NIST_CHAR2_409K = {
1331 {
1332 NID_X9_62_characteristic_two_field, 0, 52, 4
1333 },
1334 {
1335 /* no seed */
1336 /* p */
1337 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1338 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1339 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1340 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1341 0x00, 0x00, 0x00, 0x01,
1342 /* a */
1343 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1344 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1345 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1346 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1347 0x00, 0x00, 0x00, 0x00,
1348 /* b */
1349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1350 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1351 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1352 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1353 0x00, 0x00, 0x00, 0x01,
1354 /* x */
1355 0x00, 0x60, 0xF0, 0x5F, 0x65, 0x8F, 0x49, 0xC1, 0xAD, 0x3A, 0xB1, 0x89,
1356 0x0F, 0x71, 0x84, 0x21, 0x0E, 0xFD, 0x09, 0x87, 0xE3, 0x07, 0xC8, 0x4C,
1357 0x27, 0xAC, 0xCF, 0xB8, 0xF9, 0xF6, 0x7C, 0xC2, 0xC4, 0x60, 0x18, 0x9E,
1358 0xB5, 0xAA, 0xAA, 0x62, 0xEE, 0x22, 0x2E, 0xB1, 0xB3, 0x55, 0x40, 0xCF,
1359 0xE9, 0x02, 0x37, 0x46,
1360 /* y */
1361 0x01, 0xE3, 0x69, 0x05, 0x0B, 0x7C, 0x4E, 0x42, 0xAC, 0xBA, 0x1D, 0xAC,
1362 0xBF, 0x04, 0x29, 0x9C, 0x34, 0x60, 0x78, 0x2F, 0x91, 0x8E, 0xA4, 0x27,
1363 0xE6, 0x32, 0x51, 0x65, 0xE9, 0xEA, 0x10, 0xE3, 0xDA, 0x5F, 0x6C, 0x42,
1364 0xE9, 0xC5, 0x52, 0x15, 0xAA, 0x9C, 0xA2, 0x7A, 0x58, 0x63, 0xEC, 0x48,
1365 0xD8, 0xE0, 0x28, 0x6B,
1366 /* order */
1367 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
1368 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
1369 0xFF, 0xFF, 0xFE, 0x5F, 0x83, 0xB2, 0xD4, 0xEA, 0x20, 0x40, 0x0E, 0xC4,
1370 0x55, 0x7D, 0x5E, 0xD3, 0xE3, 0xE7, 0xCA, 0x5B, 0x4B, 0x5C, 0x83, 0xB8,
1371 0xE0, 0x1E, 0x5F, 0xCF
1372 }
1373};
1374
1375static const struct {
1376 EC_CURVE_DATA h;
1377 unsigned char data[20 + 52 * 6];
1378} _EC_NIST_CHAR2_409B = {
1379 {
1380 NID_X9_62_characteristic_two_field, 20, 52, 2
1381 },
1382 {
1383 /* seed */
1384 0x40, 0x99, 0xB5, 0xA4, 0x57, 0xF9, 0xD6, 0x9F, 0x79, 0x21, 0x3D, 0x09,
1385 0x4C, 0x4B, 0xCD, 0x4D, 0x42, 0x62, 0x21, 0x0B,
1386 /* p */
1387 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1388 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1389 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1390 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1391 0x00, 0x00, 0x00, 0x01,
1392 /* a */
1393 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1394 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1395 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1396 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1397 0x00, 0x00, 0x00, 0x01,
1398 /* b */
1399 0x00, 0x21, 0xA5, 0xC2, 0xC8, 0xEE, 0x9F, 0xEB, 0x5C, 0x4B, 0x9A, 0x75,
1400 0x3B, 0x7B, 0x47, 0x6B, 0x7F, 0xD6, 0x42, 0x2E, 0xF1, 0xF3, 0xDD, 0x67,
1401 0x47, 0x61, 0xFA, 0x99, 0xD6, 0xAC, 0x27, 0xC8, 0xA9, 0xA1, 0x97, 0xB2,
1402 0x72, 0x82, 0x2F, 0x6C, 0xD5, 0x7A, 0x55, 0xAA, 0x4F, 0x50, 0xAE, 0x31,
1403 0x7B, 0x13, 0x54, 0x5F,
1404 /* x */
1405 0x01, 0x5D, 0x48, 0x60, 0xD0, 0x88, 0xDD, 0xB3, 0x49, 0x6B, 0x0C, 0x60,
1406 0x64, 0x75, 0x62, 0x60, 0x44, 0x1C, 0xDE, 0x4A, 0xF1, 0x77, 0x1D, 0x4D,
1407 0xB0, 0x1F, 0xFE, 0x5B, 0x34, 0xE5, 0x97, 0x03, 0xDC, 0x25, 0x5A, 0x86,
1408 0x8A, 0x11, 0x80, 0x51, 0x56, 0x03, 0xAE, 0xAB, 0x60, 0x79, 0x4E, 0x54,
1409 0xBB, 0x79, 0x96, 0xA7,
1410 /* y */
1411 0x00, 0x61, 0xB1, 0xCF, 0xAB, 0x6B, 0xE5, 0xF3, 0x2B, 0xBF, 0xA7, 0x83,
1412 0x24, 0xED, 0x10, 0x6A, 0x76, 0x36, 0xB9, 0xC5, 0xA7, 0xBD, 0x19, 0x8D,
1413 0x01, 0x58, 0xAA, 0x4F, 0x54, 0x88, 0xD0, 0x8F, 0x38, 0x51, 0x4F, 0x1F,
1414 0xDF, 0x4B, 0x4F, 0x40, 0xD2, 0x18, 0x1B, 0x36, 0x81, 0xC3, 0x64, 0xBA,
1415 0x02, 0x73, 0xC7, 0x06,
1416 /* order */
1417 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1418 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1419 0x00, 0x00, 0x01, 0xE2, 0xAA, 0xD6, 0xA6, 0x12, 0xF3, 0x33, 0x07, 0xBE,
1420 0x5F, 0xA4, 0x7C, 0x3C, 0x9E, 0x05, 0x2F, 0x83, 0x81, 0x64, 0xCD, 0x37,
1421 0xD9, 0xA2, 0x11, 0x73
1422 }
1423};
1424
1425static const struct {
1426 EC_CURVE_DATA h;
1427 unsigned char data[0 + 72 * 6];
1428} _EC_NIST_CHAR2_571K = {
1429 {
1430 NID_X9_62_characteristic_two_field, 0, 72, 4
1431 },
1432 {
1433 /* no seed */
1434 /* p */
1435 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1436 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1437 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1438 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1439 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1440 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x25,
1441 /* a */
1442 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1443 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1444 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1445 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1446 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1447 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1448 /* b */
1449 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1450 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1451 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1452 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1453 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1454 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1455 /* x */
1456 0x02, 0x6E, 0xB7, 0xA8, 0x59, 0x92, 0x3F, 0xBC, 0x82, 0x18, 0x96, 0x31,
1457 0xF8, 0x10, 0x3F, 0xE4, 0xAC, 0x9C, 0xA2, 0x97, 0x00, 0x12, 0xD5, 0xD4,
1458 0x60, 0x24, 0x80, 0x48, 0x01, 0x84, 0x1C, 0xA4, 0x43, 0x70, 0x95, 0x84,
1459 0x93, 0xB2, 0x05, 0xE6, 0x47, 0xDA, 0x30, 0x4D, 0xB4, 0xCE, 0xB0, 0x8C,
1460 0xBB, 0xD1, 0xBA, 0x39, 0x49, 0x47, 0x76, 0xFB, 0x98, 0x8B, 0x47, 0x17,
1461 0x4D, 0xCA, 0x88, 0xC7, 0xE2, 0x94, 0x52, 0x83, 0xA0, 0x1C, 0x89, 0x72,
1462 /* y */
1463 0x03, 0x49, 0xDC, 0x80, 0x7F, 0x4F, 0xBF, 0x37, 0x4F, 0x4A, 0xEA, 0xDE,
1464 0x3B, 0xCA, 0x95, 0x31, 0x4D, 0xD5, 0x8C, 0xEC, 0x9F, 0x30, 0x7A, 0x54,
1465 0xFF, 0xC6, 0x1E, 0xFC, 0x00, 0x6D, 0x8A, 0x2C, 0x9D, 0x49, 0x79, 0xC0,
1466 0xAC, 0x44, 0xAE, 0xA7, 0x4F, 0xBE, 0xBB, 0xB9, 0xF7, 0x72, 0xAE, 0xDC,
1467 0xB6, 0x20, 0xB0, 0x1A, 0x7B, 0xA7, 0xAF, 0x1B, 0x32, 0x04, 0x30, 0xC8,
1468 0x59, 0x19, 0x84, 0xF6, 0x01, 0xCD, 0x4C, 0x14, 0x3E, 0xF1, 0xC7, 0xA3,
1469 /* order */
1470 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1471 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1472 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1473 0x13, 0x18, 0x50, 0xE1, 0xF1, 0x9A, 0x63, 0xE4, 0xB3, 0x91, 0xA8, 0xDB,
1474 0x91, 0x7F, 0x41, 0x38, 0xB6, 0x30, 0xD8, 0x4B, 0xE5, 0xD6, 0x39, 0x38,
1475 0x1E, 0x91, 0xDE, 0xB4, 0x5C, 0xFE, 0x77, 0x8F, 0x63, 0x7C, 0x10, 0x01
1476 }
1477};
1478
1479static const struct {
1480 EC_CURVE_DATA h;
1481 unsigned char data[20 + 72 * 6];
1482} _EC_NIST_CHAR2_571B = {
1483 {
1484 NID_X9_62_characteristic_two_field, 20, 72, 2
1485 },
1486 {
1487 /* seed */
1488 0x2A, 0xA0, 0x58, 0xF7, 0x3A, 0x0E, 0x33, 0xAB, 0x48, 0x6B, 0x0F, 0x61,
1489 0x04, 0x10, 0xC5, 0x3A, 0x7F, 0x13, 0x23, 0x10,
1490 /* p */
1491 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1492 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1493 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1494 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1495 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1496 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x25,
1497 /* a */
1498 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1499 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1500 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1501 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1502 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1503 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1504 /* b */
1505 0x02, 0xF4, 0x0E, 0x7E, 0x22, 0x21, 0xF2, 0x95, 0xDE, 0x29, 0x71, 0x17,
1506 0xB7, 0xF3, 0xD6, 0x2F, 0x5C, 0x6A, 0x97, 0xFF, 0xCB, 0x8C, 0xEF, 0xF1,
1507 0xCD, 0x6B, 0xA8, 0xCE, 0x4A, 0x9A, 0x18, 0xAD, 0x84, 0xFF, 0xAB, 0xBD,
1508 0x8E, 0xFA, 0x59, 0x33, 0x2B, 0xE7, 0xAD, 0x67, 0x56, 0xA6, 0x6E, 0x29,
1509 0x4A, 0xFD, 0x18, 0x5A, 0x78, 0xFF, 0x12, 0xAA, 0x52, 0x0E, 0x4D, 0xE7,
1510 0x39, 0xBA, 0xCA, 0x0C, 0x7F, 0xFE, 0xFF, 0x7F, 0x29, 0x55, 0x72, 0x7A,
1511 /* x */
1512 0x03, 0x03, 0x00, 0x1D, 0x34, 0xB8, 0x56, 0x29, 0x6C, 0x16, 0xC0, 0xD4,
1513 0x0D, 0x3C, 0xD7, 0x75, 0x0A, 0x93, 0xD1, 0xD2, 0x95, 0x5F, 0xA8, 0x0A,
1514 0xA5, 0xF4, 0x0F, 0xC8, 0xDB, 0x7B, 0x2A, 0xBD, 0xBD, 0xE5, 0x39, 0x50,
1515 0xF4, 0xC0, 0xD2, 0x93, 0xCD, 0xD7, 0x11, 0xA3, 0x5B, 0x67, 0xFB, 0x14,
1516 0x99, 0xAE, 0x60, 0x03, 0x86, 0x14, 0xF1, 0x39, 0x4A, 0xBF, 0xA3, 0xB4,
1517 0xC8, 0x50, 0xD9, 0x27, 0xE1, 0xE7, 0x76, 0x9C, 0x8E, 0xEC, 0x2D, 0x19,
1518 /* y */
1519 0x03, 0x7B, 0xF2, 0x73, 0x42, 0xDA, 0x63, 0x9B, 0x6D, 0xCC, 0xFF, 0xFE,
1520 0xB7, 0x3D, 0x69, 0xD7, 0x8C, 0x6C, 0x27, 0xA6, 0x00, 0x9C, 0xBB, 0xCA,
1521 0x19, 0x80, 0xF8, 0x53, 0x39, 0x21, 0xE8, 0xA6, 0x84, 0x42, 0x3E, 0x43,
1522 0xBA, 0xB0, 0x8A, 0x57, 0x62, 0x91, 0xAF, 0x8F, 0x46, 0x1B, 0xB2, 0xA8,
1523 0xB3, 0x53, 0x1D, 0x2F, 0x04, 0x85, 0xC1, 0x9B, 0x16, 0xE2, 0xF1, 0x51,
1524 0x6E, 0x23, 0xDD, 0x3C, 0x1A, 0x48, 0x27, 0xAF, 0x1B, 0x8A, 0xC1, 0x5B,
1525 /* order */
1526 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
1527 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
1528 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
1529 0xE6, 0x61, 0xCE, 0x18, 0xFF, 0x55, 0x98, 0x73, 0x08, 0x05, 0x9B, 0x18,
1530 0x68, 0x23, 0x85, 0x1E, 0xC7, 0xDD, 0x9C, 0xA1, 0x16, 0x1D, 0xE9, 0x3D,
1531 0x51, 0x74, 0xD6, 0x6E, 0x83, 0x82, 0xE9, 0xBB, 0x2F, 0xE8, 0x4E, 0x47
1532 }
1533};
1534
1535# ifndef FIPS_MODE
1536static const struct {
1537 EC_CURVE_DATA h;
1538 unsigned char data[20 + 21 * 6];
1539} _EC_X9_62_CHAR2_163V1 = {
1540 {
1541 NID_X9_62_characteristic_two_field, 20, 21, 2
1542 },
1543 {
1544 /* seed */
1545 0xD2, 0xC0, 0xFB, 0x15, 0x76, 0x08, 0x60, 0xDE, 0xF1, 0xEE, 0xF4, 0xD6,
1546 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x54,
1547 /* p */
1548 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1549 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07,
1550 /* a */
1551 0x07, 0x25, 0x46, 0xB5, 0x43, 0x52, 0x34, 0xA4, 0x22, 0xE0, 0x78, 0x96,
1552 0x75, 0xF4, 0x32, 0xC8, 0x94, 0x35, 0xDE, 0x52, 0x42,
1553 /* b */
1554 0x00, 0xC9, 0x51, 0x7D, 0x06, 0xD5, 0x24, 0x0D, 0x3C, 0xFF, 0x38, 0xC7,
1555 0x4B, 0x20, 0xB6, 0xCD, 0x4D, 0x6F, 0x9D, 0xD4, 0xD9,
1556 /* x */
1557 0x07, 0xAF, 0x69, 0x98, 0x95, 0x46, 0x10, 0x3D, 0x79, 0x32, 0x9F, 0xCC,
1558 0x3D, 0x74, 0x88, 0x0F, 0x33, 0xBB, 0xE8, 0x03, 0xCB,
1559 /* y */
1560 0x01, 0xEC, 0x23, 0x21, 0x1B, 0x59, 0x66, 0xAD, 0xEA, 0x1D, 0x3F, 0x87,
1561 0xF7, 0xEA, 0x58, 0x48, 0xAE, 0xF0, 0xB7, 0xCA, 0x9F,
1562 /* order */
1563 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE6,
1564 0x0F, 0xC8, 0x82, 0x1C, 0xC7, 0x4D, 0xAE, 0xAF, 0xC1
1565 }
1566};
1567
1568static const struct {
1569 EC_CURVE_DATA h;
1570 unsigned char data[20 + 21 * 6];
1571} _EC_X9_62_CHAR2_163V2 = {
1572 {
1573 NID_X9_62_characteristic_two_field, 20, 21, 2
1574 },
1575 {
1576 /* seed */
1577 0x53, 0x81, 0x4C, 0x05, 0x0D, 0x44, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
1578 0x15, 0x17, 0x58, 0x0C, 0xA4, 0xE2, 0x9F, 0xFD,
1579 /* p */
1580 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1581 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07,
1582 /* a */
1583 0x01, 0x08, 0xB3, 0x9E, 0x77, 0xC4, 0xB1, 0x08, 0xBE, 0xD9, 0x81, 0xED,
1584 0x0E, 0x89, 0x0E, 0x11, 0x7C, 0x51, 0x1C, 0xF0, 0x72,
1585 /* b */
1586 0x06, 0x67, 0xAC, 0xEB, 0x38, 0xAF, 0x4E, 0x48, 0x8C, 0x40, 0x74, 0x33,
1587 0xFF, 0xAE, 0x4F, 0x1C, 0x81, 0x16, 0x38, 0xDF, 0x20,
1588 /* x */
1589 0x00, 0x24, 0x26, 0x6E, 0x4E, 0xB5, 0x10, 0x6D, 0x0A, 0x96, 0x4D, 0x92,
1590 0xC4, 0x86, 0x0E, 0x26, 0x71, 0xDB, 0x9B, 0x6C, 0xC5,
1591 /* y */
1592 0x07, 0x9F, 0x68, 0x4D, 0xDF, 0x66, 0x84, 0xC5, 0xCD, 0x25, 0x8B, 0x38,
1593 0x90, 0x02, 0x1B, 0x23, 0x86, 0xDF, 0xD1, 0x9F, 0xC5,
1594 /* order */
1595 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xF6,
1596 0x4D, 0xE1, 0x15, 0x1A, 0xDB, 0xB7, 0x8F, 0x10, 0xA7
1597 }
1598};
1599
1600static const struct {
1601 EC_CURVE_DATA h;
1602 unsigned char data[20 + 21 * 6];
1603} _EC_X9_62_CHAR2_163V3 = {
1604 {
1605 NID_X9_62_characteristic_two_field, 20, 21, 2
1606 },
1607 {
1608 /* seed */
1609 0x50, 0xCB, 0xF1, 0xD9, 0x5C, 0xA9, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75,
1610 0x61, 0x51, 0x75, 0xF1, 0x6A, 0x36, 0xA3, 0xB8,
1611 /* p */
1612 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1613 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07,
1614 /* a */
1615 0x07, 0xA5, 0x26, 0xC6, 0x3D, 0x3E, 0x25, 0xA2, 0x56, 0xA0, 0x07, 0x69,
1616 0x9F, 0x54, 0x47, 0xE3, 0x2A, 0xE4, 0x56, 0xB5, 0x0E,
1617 /* b */
1618 0x03, 0xF7, 0x06, 0x17, 0x98, 0xEB, 0x99, 0xE2, 0x38, 0xFD, 0x6F, 0x1B,
1619 0xF9, 0x5B, 0x48, 0xFE, 0xEB, 0x48, 0x54, 0x25, 0x2B,
1620 /* x */
1621 0x02, 0xF9, 0xF8, 0x7B, 0x7C, 0x57, 0x4D, 0x0B, 0xDE, 0xCF, 0x8A, 0x22,
1622 0xE6, 0x52, 0x47, 0x75, 0xF9, 0x8C, 0xDE, 0xBD, 0xCB,
1623 /* y */
1624 0x05, 0xB9, 0x35, 0x59, 0x0C, 0x15, 0x5E, 0x17, 0xEA, 0x48, 0xEB, 0x3F,
1625 0xF3, 0x71, 0x8B, 0x89, 0x3D, 0xF5, 0x9A, 0x05, 0xD0,
1626 /* order */
1627 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x1A,
1628 0xEE, 0x14, 0x0F, 0x11, 0x0A, 0xFF, 0x96, 0x13, 0x09
1629 }
1630};
1631
1632static const struct {
1633 EC_CURVE_DATA h;
1634 unsigned char data[0 + 23 * 6];
1635} _EC_X9_62_CHAR2_176V1 = {
1636 {
1637 NID_X9_62_characteristic_two_field, 0, 23, 0xFF6E
1638 },
1639 {
1640 /* no seed */
1641 /* p */
1642 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1643 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x07,
1644 /* a */
1645 0x00, 0xE4, 0xE6, 0xDB, 0x29, 0x95, 0x06, 0x5C, 0x40, 0x7D, 0x9D, 0x39,
1646 0xB8, 0xD0, 0x96, 0x7B, 0x96, 0x70, 0x4B, 0xA8, 0xE9, 0xC9, 0x0B,
1647 /* b */
1648 0x00, 0x5D, 0xDA, 0x47, 0x0A, 0xBE, 0x64, 0x14, 0xDE, 0x8E, 0xC1, 0x33,
1649 0xAE, 0x28, 0xE9, 0xBB, 0xD7, 0xFC, 0xEC, 0x0A, 0xE0, 0xFF, 0xF2,
1650 /* x */
1651 0x00, 0x8D, 0x16, 0xC2, 0x86, 0x67, 0x98, 0xB6, 0x00, 0xF9, 0xF0, 0x8B,
1652 0xB4, 0xA8, 0xE8, 0x60, 0xF3, 0x29, 0x8C, 0xE0, 0x4A, 0x57, 0x98,
1653 /* y */
1654 0x00, 0x6F, 0xA4, 0x53, 0x9C, 0x2D, 0xAD, 0xDD, 0xD6, 0xBA, 0xB5, 0x16,
1655 0x7D, 0x61, 0xB4, 0x36, 0xE1, 0xD9, 0x2B, 0xB1, 0x6A, 0x56, 0x2C,
1656 /* order */
1657 0x00, 0x00, 0x01, 0x00, 0x92, 0x53, 0x73, 0x97, 0xEC, 0xA4, 0xF6, 0x14,
1658 0x57, 0x99, 0xD6, 0x2B, 0x0A, 0x19, 0xCE, 0x06, 0xFE, 0x26, 0xAD
1659 }
1660};
1661
1662static const struct {
1663 EC_CURVE_DATA h;
1664 unsigned char data[20 + 24 * 6];
1665} _EC_X9_62_CHAR2_191V1 = {
1666 {
1667 NID_X9_62_characteristic_two_field, 20, 24, 2
1668 },
1669 {
1670 /* seed */
1671 0x4E, 0x13, 0xCA, 0x54, 0x27, 0x44, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
1672 0x15, 0x17, 0x55, 0x2F, 0x27, 0x9A, 0x8C, 0x84,
1673 /* p */
1674 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1675 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
1676 /* a */
1677 0x28, 0x66, 0x53, 0x7B, 0x67, 0x67, 0x52, 0x63, 0x6A, 0x68, 0xF5, 0x65,
1678 0x54, 0xE1, 0x26, 0x40, 0x27, 0x6B, 0x64, 0x9E, 0xF7, 0x52, 0x62, 0x67,
1679 /* b */
1680 0x2E, 0x45, 0xEF, 0x57, 0x1F, 0x00, 0x78, 0x6F, 0x67, 0xB0, 0x08, 0x1B,
1681 0x94, 0x95, 0xA3, 0xD9, 0x54, 0x62, 0xF5, 0xDE, 0x0A, 0xA1, 0x85, 0xEC,
1682 /* x */
1683 0x36, 0xB3, 0xDA, 0xF8, 0xA2, 0x32, 0x06, 0xF9, 0xC4, 0xF2, 0x99, 0xD7,
1684 0xB2, 0x1A, 0x9C, 0x36, 0x91, 0x37, 0xF2, 0xC8, 0x4A, 0xE1, 0xAA, 0x0D,
1685 /* y */
1686 0x76, 0x5B, 0xE7, 0x34, 0x33, 0xB3, 0xF9, 0x5E, 0x33, 0x29, 0x32, 0xE7,
1687 0x0E, 0xA2, 0x45, 0xCA, 0x24, 0x18, 0xEA, 0x0E, 0xF9, 0x80, 0x18, 0xFB,
1688 /* order */
1689 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1690 0x04, 0xA2, 0x0E, 0x90, 0xC3, 0x90, 0x67, 0xC8, 0x93, 0xBB, 0xB9, 0xA5
1691 }
1692};
1693
1694static const struct {
1695 EC_CURVE_DATA h;
1696 unsigned char data[20 + 24 * 6];
1697} _EC_X9_62_CHAR2_191V2 = {
1698 {
1699 NID_X9_62_characteristic_two_field, 20, 24, 4
1700 },
1701 {
1702 /* seed */
1703 0x08, 0x71, 0xEF, 0x2F, 0xEF, 0x24, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
1704 0x15, 0x17, 0x58, 0xBE, 0xE0, 0xD9, 0x5C, 0x15,
1705 /* p */
1706 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1707 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
1708 /* a */
1709 0x40, 0x10, 0x28, 0x77, 0x4D, 0x77, 0x77, 0xC7, 0xB7, 0x66, 0x6D, 0x13,
1710 0x66, 0xEA, 0x43, 0x20, 0x71, 0x27, 0x4F, 0x89, 0xFF, 0x01, 0xE7, 0x18,
1711 /* b */
1712 0x06, 0x20, 0x04, 0x8D, 0x28, 0xBC, 0xBD, 0x03, 0xB6, 0x24, 0x9C, 0x99,
1713 0x18, 0x2B, 0x7C, 0x8C, 0xD1, 0x97, 0x00, 0xC3, 0x62, 0xC4, 0x6A, 0x01,
1714 /* x */
1715 0x38, 0x09, 0xB2, 0xB7, 0xCC, 0x1B, 0x28, 0xCC, 0x5A, 0x87, 0x92, 0x6A,
1716 0xAD, 0x83, 0xFD, 0x28, 0x78, 0x9E, 0x81, 0xE2, 0xC9, 0xE3, 0xBF, 0x10,
1717 /* y */
1718 0x17, 0x43, 0x43, 0x86, 0x62, 0x6D, 0x14, 0xF3, 0xDB, 0xF0, 0x17, 0x60,
1719 0xD9, 0x21, 0x3A, 0x3E, 0x1C, 0xF3, 0x7A, 0xEC, 0x43, 0x7D, 0x66, 0x8A,
1720 /* order */
1721 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1722 0x50, 0x50, 0x8C, 0xB8, 0x9F, 0x65, 0x28, 0x24, 0xE0, 0x6B, 0x81, 0x73
1723 }
1724};
1725
1726static const struct {
1727 EC_CURVE_DATA h;
1728 unsigned char data[20 + 24 * 6];
1729} _EC_X9_62_CHAR2_191V3 = {
1730 {
1731 NID_X9_62_characteristic_two_field, 20, 24, 6
1732 },
1733 {
1734 /* seed */
1735 0xE0, 0x53, 0x51, 0x2D, 0xC6, 0x84, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
1736 0x15, 0x17, 0x50, 0x67, 0xAE, 0x78, 0x6D, 0x1F,
1737 /* p */
1738 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1739 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
1740 /* a */
1741 0x6C, 0x01, 0x07, 0x47, 0x56, 0x09, 0x91, 0x22, 0x22, 0x10, 0x56, 0x91,
1742 0x1C, 0x77, 0xD7, 0x7E, 0x77, 0xA7, 0x77, 0xE7, 0xE7, 0xE7, 0x7F, 0xCB,
1743 /* b */
1744 0x71, 0xFE, 0x1A, 0xF9, 0x26, 0xCF, 0x84, 0x79, 0x89, 0xEF, 0xEF, 0x8D,
1745 0xB4, 0x59, 0xF6, 0x63, 0x94, 0xD9, 0x0F, 0x32, 0xAD, 0x3F, 0x15, 0xE8,
1746 /* x */
1747 0x37, 0x5D, 0x4C, 0xE2, 0x4F, 0xDE, 0x43, 0x44, 0x89, 0xDE, 0x87, 0x46,
1748 0xE7, 0x17, 0x86, 0x01, 0x50, 0x09, 0xE6, 0x6E, 0x38, 0xA9, 0x26, 0xDD,
1749 /* y */
1750 0x54, 0x5A, 0x39, 0x17, 0x61, 0x96, 0x57, 0x5D, 0x98, 0x59, 0x99, 0x36,
1751 0x6E, 0x6A, 0xD3, 0x4C, 0xE0, 0xA7, 0x7C, 0xD7, 0x12, 0x7B, 0x06, 0xBE,
1752 /* order */
1753 0x15, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
1754 0x61, 0x0C, 0x0B, 0x19, 0x68, 0x12, 0xBF, 0xB6, 0x28, 0x8A, 0x3E, 0xA3
1755 }
1756};
1757
1758static const struct {
1759 EC_CURVE_DATA h;
1760 unsigned char data[0 + 27 * 6];
1761} _EC_X9_62_CHAR2_208W1 = {
1762 {
1763 NID_X9_62_characteristic_two_field, 0, 27, 0xFE48
1764 },
1765 {
1766 /* no seed */
1767 /* p */
1768 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1769 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1770 0x00, 0x00, 0x07,
1771 /* a */
1772 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1773 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1774 0x00, 0x00, 0x00,
1775 /* b */
1776 0x00, 0xC8, 0x61, 0x9E, 0xD4, 0x5A, 0x62, 0xE6, 0x21, 0x2E, 0x11, 0x60,
1777 0x34, 0x9E, 0x2B, 0xFA, 0x84, 0x44, 0x39, 0xFA, 0xFC, 0x2A, 0x3F, 0xD1,
1778 0x63, 0x8F, 0x9E,
1779 /* x */
1780 0x00, 0x89, 0xFD, 0xFB, 0xE4, 0xAB, 0xE1, 0x93, 0xDF, 0x95, 0x59, 0xEC,
1781 0xF0, 0x7A, 0xC0, 0xCE, 0x78, 0x55, 0x4E, 0x27, 0x84, 0xEB, 0x8C, 0x1E,
1782 0xD1, 0xA5, 0x7A,
1783 /* y */
1784 0x00, 0x0F, 0x55, 0xB5, 0x1A, 0x06, 0xE7, 0x8E, 0x9A, 0xC3, 0x8A, 0x03,
1785 0x5F, 0xF5, 0x20, 0xD8, 0xB0, 0x17, 0x81, 0xBE, 0xB1, 0xA6, 0xBB, 0x08,
1786 0x61, 0x7D, 0xE3,
1787 /* order */
1788 0x00, 0x00, 0x01, 0x01, 0xBA, 0xF9, 0x5C, 0x97, 0x23, 0xC5, 0x7B, 0x6C,
1789 0x21, 0xDA, 0x2E, 0xFF, 0x2D, 0x5E, 0xD5, 0x88, 0xBD, 0xD5, 0x71, 0x7E,
1790 0x21, 0x2F, 0x9D
1791 }
1792};
1793
1794static const struct {
1795 EC_CURVE_DATA h;
1796 unsigned char data[20 + 30 * 6];
1797} _EC_X9_62_CHAR2_239V1 = {
1798 {
1799 NID_X9_62_characteristic_two_field, 20, 30, 4
1800 },
1801 {
1802 /* seed */
1803 0xD3, 0x4B, 0x9A, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75,
1804 0xCA, 0x71, 0xB9, 0x20, 0xBF, 0xEF, 0xB0, 0x5D,
1805 /* p */
1806 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1807 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1808 0x00, 0x10, 0x00, 0x00, 0x00, 0x01,
1809 /* a */
1810 0x32, 0x01, 0x08, 0x57, 0x07, 0x7C, 0x54, 0x31, 0x12, 0x3A, 0x46, 0xB8,
1811 0x08, 0x90, 0x67, 0x56, 0xF5, 0x43, 0x42, 0x3E, 0x8D, 0x27, 0x87, 0x75,
1812 0x78, 0x12, 0x57, 0x78, 0xAC, 0x76,
1813 /* b */
1814 0x79, 0x04, 0x08, 0xF2, 0xEE, 0xDA, 0xF3, 0x92, 0xB0, 0x12, 0xED, 0xEF,
1815 0xB3, 0x39, 0x2F, 0x30, 0xF4, 0x32, 0x7C, 0x0C, 0xA3, 0xF3, 0x1F, 0xC3,
1816 0x83, 0xC4, 0x22, 0xAA, 0x8C, 0x16,
1817 /* x */
1818 0x57, 0x92, 0x70, 0x98, 0xFA, 0x93, 0x2E, 0x7C, 0x0A, 0x96, 0xD3, 0xFD,
1819 0x5B, 0x70, 0x6E, 0xF7, 0xE5, 0xF5, 0xC1, 0x56, 0xE1, 0x6B, 0x7E, 0x7C,
1820 0x86, 0x03, 0x85, 0x52, 0xE9, 0x1D,
1821 /* y */
1822 0x61, 0xD8, 0xEE, 0x50, 0x77, 0xC3, 0x3F, 0xEC, 0xF6, 0xF1, 0xA1, 0x6B,
1823 0x26, 0x8D, 0xE4, 0x69, 0xC3, 0xC7, 0x74, 0x4E, 0xA9, 0xA9, 0x71, 0x64,
1824 0x9F, 0xC7, 0xA9, 0x61, 0x63, 0x05,
1825 /* order */
1826 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1827 0x00, 0x00, 0x00, 0x0F, 0x4D, 0x42, 0xFF, 0xE1, 0x49, 0x2A, 0x49, 0x93,
1828 0xF1, 0xCA, 0xD6, 0x66, 0xE4, 0x47
1829 }
1830};
1831
1832static const struct {
1833 EC_CURVE_DATA h;
1834 unsigned char data[20 + 30 * 6];
1835} _EC_X9_62_CHAR2_239V2 = {
1836 {
1837 NID_X9_62_characteristic_two_field, 20, 30, 6
1838 },
1839 {
1840 /* seed */
1841 0x2A, 0xA6, 0x98, 0x2F, 0xDF, 0xA4, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
1842 0x15, 0x17, 0x5D, 0x26, 0x67, 0x27, 0x27, 0x7D,
1843 /* p */
1844 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1845 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1846 0x00, 0x10, 0x00, 0x00, 0x00, 0x01,
1847 /* a */
1848 0x42, 0x30, 0x01, 0x77, 0x57, 0xA7, 0x67, 0xFA, 0xE4, 0x23, 0x98, 0x56,
1849 0x9B, 0x74, 0x63, 0x25, 0xD4, 0x53, 0x13, 0xAF, 0x07, 0x66, 0x26, 0x64,
1850 0x79, 0xB7, 0x56, 0x54, 0xE6, 0x5F,
1851 /* b */
1852 0x50, 0x37, 0xEA, 0x65, 0x41, 0x96, 0xCF, 0xF0, 0xCD, 0x82, 0xB2, 0xC1,
1853 0x4A, 0x2F, 0xCF, 0x2E, 0x3F, 0xF8, 0x77, 0x52, 0x85, 0xB5, 0x45, 0x72,
1854 0x2F, 0x03, 0xEA, 0xCD, 0xB7, 0x4B,
1855 /* x */
1856 0x28, 0xF9, 0xD0, 0x4E, 0x90, 0x00, 0x69, 0xC8, 0xDC, 0x47, 0xA0, 0x85,
1857 0x34, 0xFE, 0x76, 0xD2, 0xB9, 0x00, 0xB7, 0xD7, 0xEF, 0x31, 0xF5, 0x70,
1858 0x9F, 0x20, 0x0C, 0x4C, 0xA2, 0x05,
1859 /* y */
1860 0x56, 0x67, 0x33, 0x4C, 0x45, 0xAF, 0xF3, 0xB5, 0xA0, 0x3B, 0xAD, 0x9D,
1861 0xD7, 0x5E, 0x2C, 0x71, 0xA9, 0x93, 0x62, 0x56, 0x7D, 0x54, 0x53, 0xF7,
1862 0xFA, 0x6E, 0x22, 0x7E, 0xC8, 0x33,
1863 /* order */
1864 0x15, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
1865 0x55, 0x55, 0x55, 0x3C, 0x6F, 0x28, 0x85, 0x25, 0x9C, 0x31, 0xE3, 0xFC,
1866 0xDF, 0x15, 0x46, 0x24, 0x52, 0x2D
1867 }
1868};
1869
1870static const struct {
1871 EC_CURVE_DATA h;
1872 unsigned char data[20 + 30 * 6];
1873} _EC_X9_62_CHAR2_239V3 = {
1874 {
1875 NID_X9_62_characteristic_two_field, 20, 30, 0xA
1876 },
1877 {
1878 /* seed */
1879 0x9E, 0x07, 0x6F, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75,
1880 0xE1, 0x1E, 0x9F, 0xDD, 0x77, 0xF9, 0x20, 0x41,
1881 /* p */
1882 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1883 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1884 0x00, 0x10, 0x00, 0x00, 0x00, 0x01,
1885 /* a */
1886 0x01, 0x23, 0x87, 0x74, 0x66, 0x6A, 0x67, 0x76, 0x6D, 0x66, 0x76, 0xF7,
1887 0x78, 0xE6, 0x76, 0xB6, 0x69, 0x99, 0x17, 0x66, 0x66, 0xE6, 0x87, 0x66,
1888 0x6D, 0x87, 0x66, 0xC6, 0x6A, 0x9F,
1889 /* b */
1890 0x6A, 0x94, 0x19, 0x77, 0xBA, 0x9F, 0x6A, 0x43, 0x51, 0x99, 0xAC, 0xFC,
1891 0x51, 0x06, 0x7E, 0xD5, 0x87, 0xF5, 0x19, 0xC5, 0xEC, 0xB5, 0x41, 0xB8,
1892 0xE4, 0x41, 0x11, 0xDE, 0x1D, 0x40,
1893 /* x */
1894 0x70, 0xF6, 0xE9, 0xD0, 0x4D, 0x28, 0x9C, 0x4E, 0x89, 0x91, 0x3C, 0xE3,
1895 0x53, 0x0B, 0xFD, 0xE9, 0x03, 0x97, 0x7D, 0x42, 0xB1, 0x46, 0xD5, 0x39,
1896 0xBF, 0x1B, 0xDE, 0x4E, 0x9C, 0x92,
1897 /* y */
1898 0x2E, 0x5A, 0x0E, 0xAF, 0x6E, 0x5E, 0x13, 0x05, 0xB9, 0x00, 0x4D, 0xCE,
1899 0x5C, 0x0E, 0xD7, 0xFE, 0x59, 0xA3, 0x56, 0x08, 0xF3, 0x38, 0x37, 0xC8,
1900 0x16, 0xD8, 0x0B, 0x79, 0xF4, 0x61,
1901 /* order */
1902 0x0C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
1903 0xCC, 0xCC, 0xCC, 0xAC, 0x49, 0x12, 0xD2, 0xD9, 0xDF, 0x90, 0x3E, 0xF9,
1904 0x88, 0x8B, 0x8A, 0x0E, 0x4C, 0xFF
1905 }
1906};
1907
1908static const struct {
1909 EC_CURVE_DATA h;
1910 unsigned char data[0 + 35 * 6];
1911} _EC_X9_62_CHAR2_272W1 = {
1912 {
1913 NID_X9_62_characteristic_two_field, 0, 35, 0xFF06
1914 },
1915 {
1916 /* no seed */
1917 /* p */
1918 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1919 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1920 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B,
1921 /* a */
1922 0x00, 0x91, 0xA0, 0x91, 0xF0, 0x3B, 0x5F, 0xBA, 0x4A, 0xB2, 0xCC, 0xF4,
1923 0x9C, 0x4E, 0xDD, 0x22, 0x0F, 0xB0, 0x28, 0x71, 0x2D, 0x42, 0xBE, 0x75,
1924 0x2B, 0x2C, 0x40, 0x09, 0x4D, 0xBA, 0xCD, 0xB5, 0x86, 0xFB, 0x20,
1925 /* b */
1926 0x00, 0x71, 0x67, 0xEF, 0xC9, 0x2B, 0xB2, 0xE3, 0xCE, 0x7C, 0x8A, 0xAA,
1927 0xFF, 0x34, 0xE1, 0x2A, 0x9C, 0x55, 0x70, 0x03, 0xD7, 0xC7, 0x3A, 0x6F,
1928 0xAF, 0x00, 0x3F, 0x99, 0xF6, 0xCC, 0x84, 0x82, 0xE5, 0x40, 0xF7,
1929 /* x */
1930 0x00, 0x61, 0x08, 0xBA, 0xBB, 0x2C, 0xEE, 0xBC, 0xF7, 0x87, 0x05, 0x8A,
1931 0x05, 0x6C, 0xBE, 0x0C, 0xFE, 0x62, 0x2D, 0x77, 0x23, 0xA2, 0x89, 0xE0,
1932 0x8A, 0x07, 0xAE, 0x13, 0xEF, 0x0D, 0x10, 0xD1, 0x71, 0xDD, 0x8D,
1933 /* y */
1934 0x00, 0x10, 0xC7, 0x69, 0x57, 0x16, 0x85, 0x1E, 0xEF, 0x6B, 0xA7, 0xF6,
1935 0x87, 0x2E, 0x61, 0x42, 0xFB, 0xD2, 0x41, 0xB8, 0x30, 0xFF, 0x5E, 0xFC,
1936 0xAC, 0xEC, 0xCA, 0xB0, 0x5E, 0x02, 0x00, 0x5D, 0xDE, 0x9D, 0x23,
1937 /* order */
1938 0x00, 0x00, 0x01, 0x00, 0xFA, 0xF5, 0x13, 0x54, 0xE0, 0xE3, 0x9E, 0x48,
1939 0x92, 0xDF, 0x6E, 0x31, 0x9C, 0x72, 0xC8, 0x16, 0x16, 0x03, 0xFA, 0x45,
1940 0xAA, 0x7B, 0x99, 0x8A, 0x16, 0x7B, 0x8F, 0x1E, 0x62, 0x95, 0x21
1941 }
1942};
1943
1944static const struct {
1945 EC_CURVE_DATA h;
1946 unsigned char data[0 + 39 * 6];
1947} _EC_X9_62_CHAR2_304W1 = {
1948 {
1949 NID_X9_62_characteristic_two_field, 0, 39, 0xFE2E
1950 },
1951 {
1952 /* no seed */
1953 /* p */
1954 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1955 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1956 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1957 0x00, 0x08, 0x07,
1958 /* a */
1959 0x00, 0xFD, 0x0D, 0x69, 0x31, 0x49, 0xA1, 0x18, 0xF6, 0x51, 0xE6, 0xDC,
1960 0xE6, 0x80, 0x20, 0x85, 0x37, 0x7E, 0x5F, 0x88, 0x2D, 0x1B, 0x51, 0x0B,
1961 0x44, 0x16, 0x00, 0x74, 0xC1, 0x28, 0x80, 0x78, 0x36, 0x5A, 0x03, 0x96,
1962 0xC8, 0xE6, 0x81,
1963 /* b */
1964 0x00, 0xBD, 0xDB, 0x97, 0xE5, 0x55, 0xA5, 0x0A, 0x90, 0x8E, 0x43, 0xB0,
1965 0x1C, 0x79, 0x8E, 0xA5, 0xDA, 0xA6, 0x78, 0x8F, 0x1E, 0xA2, 0x79, 0x4E,
1966 0xFC, 0xF5, 0x71, 0x66, 0xB8, 0xC1, 0x40, 0x39, 0x60, 0x1E, 0x55, 0x82,
1967 0x73, 0x40, 0xBE,
1968 /* x */
1969 0x00, 0x19, 0x7B, 0x07, 0x84, 0x5E, 0x9B, 0xE2, 0xD9, 0x6A, 0xDB, 0x0F,
1970 0x5F, 0x3C, 0x7F, 0x2C, 0xFF, 0xBD, 0x7A, 0x3E, 0xB8, 0xB6, 0xFE, 0xC3,
1971 0x5C, 0x7F, 0xD6, 0x7F, 0x26, 0xDD, 0xF6, 0x28, 0x5A, 0x64, 0x4F, 0x74,
1972 0x0A, 0x26, 0x14,
1973 /* y */
1974 0x00, 0xE1, 0x9F, 0xBE, 0xB7, 0x6E, 0x0D, 0xA1, 0x71, 0x51, 0x7E, 0xCF,
1975 0x40, 0x1B, 0x50, 0x28, 0x9B, 0xF0, 0x14, 0x10, 0x32, 0x88, 0x52, 0x7A,
1976 0x9B, 0x41, 0x6A, 0x10, 0x5E, 0x80, 0x26, 0x0B, 0x54, 0x9F, 0xDC, 0x1B,
1977 0x92, 0xC0, 0x3B,
1978 /* order */
1979 0x00, 0x00, 0x01, 0x01, 0xD5, 0x56, 0x57, 0x2A, 0xAB, 0xAC, 0x80, 0x01,
1980 0x01, 0xD5, 0x56, 0x57, 0x2A, 0xAB, 0xAC, 0x80, 0x01, 0x02, 0x2D, 0x5C,
1981 0x91, 0xDD, 0x17, 0x3F, 0x8F, 0xB5, 0x61, 0xDA, 0x68, 0x99, 0x16, 0x44,
1982 0x43, 0x05, 0x1D
1983 }
1984};
1985
1986static const struct {
1987 EC_CURVE_DATA h;
1988 unsigned char data[20 + 45 * 6];
1989} _EC_X9_62_CHAR2_359V1 = {
1990 {
1991 NID_X9_62_characteristic_two_field, 20, 45, 0x4C
1992 },
1993 {
1994 /* seed */
1995 0x2B, 0x35, 0x49, 0x20, 0xB7, 0x24, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
1996 0x15, 0x17, 0x58, 0x5B, 0xA1, 0x33, 0x2D, 0xC6,
1997 /* p */
1998 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1999 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2000 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2001 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
2002 /* a */
2003 0x56, 0x67, 0x67, 0x6A, 0x65, 0x4B, 0x20, 0x75, 0x4F, 0x35, 0x6E, 0xA9,
2004 0x20, 0x17, 0xD9, 0x46, 0x56, 0x7C, 0x46, 0x67, 0x55, 0x56, 0xF1, 0x95,
2005 0x56, 0xA0, 0x46, 0x16, 0xB5, 0x67, 0xD2, 0x23, 0xA5, 0xE0, 0x56, 0x56,
2006 0xFB, 0x54, 0x90, 0x16, 0xA9, 0x66, 0x56, 0xA5, 0x57,
2007 /* b */
2008 0x24, 0x72, 0xE2, 0xD0, 0x19, 0x7C, 0x49, 0x36, 0x3F, 0x1F, 0xE7, 0xF5,
2009 0xB6, 0xDB, 0x07, 0x5D, 0x52, 0xB6, 0x94, 0x7D, 0x13, 0x5D, 0x8C, 0xA4,
2010 0x45, 0x80, 0x5D, 0x39, 0xBC, 0x34, 0x56, 0x26, 0x08, 0x96, 0x87, 0x74,
2011 0x2B, 0x63, 0x29, 0xE7, 0x06, 0x80, 0x23, 0x19, 0x88,
2012 /* x */
2013 0x3C, 0x25, 0x8E, 0xF3, 0x04, 0x77, 0x67, 0xE7, 0xED, 0xE0, 0xF1, 0xFD,
2014 0xAA, 0x79, 0xDA, 0xEE, 0x38, 0x41, 0x36, 0x6A, 0x13, 0x2E, 0x16, 0x3A,
2015 0xCE, 0xD4, 0xED, 0x24, 0x01, 0xDF, 0x9C, 0x6B, 0xDC, 0xDE, 0x98, 0xE8,
2016 0xE7, 0x07, 0xC0, 0x7A, 0x22, 0x39, 0xB1, 0xB0, 0x97,
2017 /* y */
2018 0x53, 0xD7, 0xE0, 0x85, 0x29, 0x54, 0x70, 0x48, 0x12, 0x1E, 0x9C, 0x95,
2019 0xF3, 0x79, 0x1D, 0xD8, 0x04, 0x96, 0x39, 0x48, 0xF3, 0x4F, 0xAE, 0x7B,
2020 0xF4, 0x4E, 0xA8, 0x23, 0x65, 0xDC, 0x78, 0x68, 0xFE, 0x57, 0xE4, 0xAE,
2021 0x2D, 0xE2, 0x11, 0x30, 0x5A, 0x40, 0x71, 0x04, 0xBD,
2022 /* order */
2023 0x01, 0xAF, 0x28, 0x6B, 0xCA, 0x1A, 0xF2, 0x86, 0xBC, 0xA1, 0xAF, 0x28,
2024 0x6B, 0xCA, 0x1A, 0xF2, 0x86, 0xBC, 0xA1, 0xAF, 0x28, 0x6B, 0xC9, 0xFB,
2025 0x8F, 0x6B, 0x85, 0xC5, 0x56, 0x89, 0x2C, 0x20, 0xA7, 0xEB, 0x96, 0x4F,
2026 0xE7, 0x71, 0x9E, 0x74, 0xF4, 0x90, 0x75, 0x8D, 0x3B
2027 }
2028};
2029
2030static const struct {
2031 EC_CURVE_DATA h;
2032 unsigned char data[0 + 47 * 6];
2033} _EC_X9_62_CHAR2_368W1 = {
2034 {
2035 NID_X9_62_characteristic_two_field, 0, 47, 0xFF70
2036 },
2037 {
2038 /* no seed */
2039 /* p */
2040 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2041 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2042 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2043 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
2044 /* a */
2045 0x00, 0xE0, 0xD2, 0xEE, 0x25, 0x09, 0x52, 0x06, 0xF5, 0xE2, 0xA4, 0xF9,
2046 0xED, 0x22, 0x9F, 0x1F, 0x25, 0x6E, 0x79, 0xA0, 0xE2, 0xB4, 0x55, 0x97,
2047 0x0D, 0x8D, 0x0D, 0x86, 0x5B, 0xD9, 0x47, 0x78, 0xC5, 0x76, 0xD6, 0x2F,
2048 0x0A, 0xB7, 0x51, 0x9C, 0xCD, 0x2A, 0x1A, 0x90, 0x6A, 0xE3, 0x0D,
2049 /* b */
2050 0x00, 0xFC, 0x12, 0x17, 0xD4, 0x32, 0x0A, 0x90, 0x45, 0x2C, 0x76, 0x0A,
2051 0x58, 0xED, 0xCD, 0x30, 0xC8, 0xDD, 0x06, 0x9B, 0x3C, 0x34, 0x45, 0x38,
2052 0x37, 0xA3, 0x4E, 0xD5, 0x0C, 0xB5, 0x49, 0x17, 0xE1, 0xC2, 0x11, 0x2D,
2053 0x84, 0xD1, 0x64, 0xF4, 0x44, 0xF8, 0xF7, 0x47, 0x86, 0x04, 0x6A,
2054 /* x */
2055 0x00, 0x10, 0x85, 0xE2, 0x75, 0x53, 0x81, 0xDC, 0xCC, 0xE3, 0xC1, 0x55,
2056 0x7A, 0xFA, 0x10, 0xC2, 0xF0, 0xC0, 0xC2, 0x82, 0x56, 0x46, 0xC5, 0xB3,
2057 0x4A, 0x39, 0x4C, 0xBC, 0xFA, 0x8B, 0xC1, 0x6B, 0x22, 0xE7, 0xE7, 0x89,
2058 0xE9, 0x27, 0xBE, 0x21, 0x6F, 0x02, 0xE1, 0xFB, 0x13, 0x6A, 0x5F,
2059 /* y */
2060 0x00, 0x7B, 0x3E, 0xB1, 0xBD, 0xDC, 0xBA, 0x62, 0xD5, 0xD8, 0xB2, 0x05,
2061 0x9B, 0x52, 0x57, 0x97, 0xFC, 0x73, 0x82, 0x2C, 0x59, 0x05, 0x9C, 0x62,
2062 0x3A, 0x45, 0xFF, 0x38, 0x43, 0xCE, 0xE8, 0xF8, 0x7C, 0xD1, 0x85, 0x5A,
2063 0xDA, 0xA8, 0x1E, 0x2A, 0x07, 0x50, 0xB8, 0x0F, 0xDA, 0x23, 0x10,
2064 /* order */
2065 0x00, 0x00, 0x01, 0x00, 0x90, 0x51, 0x2D, 0xA9, 0xAF, 0x72, 0xB0, 0x83,
2066 0x49, 0xD9, 0x8A, 0x5D, 0xD4, 0xC7, 0xB0, 0x53, 0x2E, 0xCA, 0x51, 0xCE,
2067 0x03, 0xE2, 0xD1, 0x0F, 0x3B, 0x7A, 0xC5, 0x79, 0xBD, 0x87, 0xE9, 0x09,
2068 0xAE, 0x40, 0xA6, 0xF1, 0x31, 0xE9, 0xCF, 0xCE, 0x5B, 0xD9, 0x67
2069 }
2070};
2071
2072static const struct {
2073 EC_CURVE_DATA h;
2074 unsigned char data[0 + 54 * 6];
2075} _EC_X9_62_CHAR2_431R1 = {
2076 {
2077 NID_X9_62_characteristic_two_field, 0, 54, 0x2760
2078 },
2079 {
2080 /* no seed */
2081 /* p */
2082 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2083 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2084 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2085 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2086 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
2087 /* a */
2088 0x1A, 0x82, 0x7E, 0xF0, 0x0D, 0xD6, 0xFC, 0x0E, 0x23, 0x4C, 0xAF, 0x04,
2089 0x6C, 0x6A, 0x5D, 0x8A, 0x85, 0x39, 0x5B, 0x23, 0x6C, 0xC4, 0xAD, 0x2C,
2090 0xF3, 0x2A, 0x0C, 0xAD, 0xBD, 0xC9, 0xDD, 0xF6, 0x20, 0xB0, 0xEB, 0x99,
2091 0x06, 0xD0, 0x95, 0x7F, 0x6C, 0x6F, 0xEA, 0xCD, 0x61, 0x54, 0x68, 0xDF,
2092 0x10, 0x4D, 0xE2, 0x96, 0xCD, 0x8F,
2093 /* b */
2094 0x10, 0xD9, 0xB4, 0xA3, 0xD9, 0x04, 0x7D, 0x8B, 0x15, 0x43, 0x59, 0xAB,
2095 0xFB, 0x1B, 0x7F, 0x54, 0x85, 0xB0, 0x4C, 0xEB, 0x86, 0x82, 0x37, 0xDD,
2096 0xC9, 0xDE, 0xDA, 0x98, 0x2A, 0x67, 0x9A, 0x5A, 0x91, 0x9B, 0x62, 0x6D,
2097 0x4E, 0x50, 0xA8, 0xDD, 0x73, 0x1B, 0x10, 0x7A, 0x99, 0x62, 0x38, 0x1F,
2098 0xB5, 0xD8, 0x07, 0xBF, 0x26, 0x18,
2099 /* x */
2100 0x12, 0x0F, 0xC0, 0x5D, 0x3C, 0x67, 0xA9, 0x9D, 0xE1, 0x61, 0xD2, 0xF4,
2101 0x09, 0x26, 0x22, 0xFE, 0xCA, 0x70, 0x1B, 0xE4, 0xF5, 0x0F, 0x47, 0x58,
2102 0x71, 0x4E, 0x8A, 0x87, 0xBB, 0xF2, 0xA6, 0x58, 0xEF, 0x8C, 0x21, 0xE7,
2103 0xC5, 0xEF, 0xE9, 0x65, 0x36, 0x1F, 0x6C, 0x29, 0x99, 0xC0, 0xC2, 0x47,
2104 0xB0, 0xDB, 0xD7, 0x0C, 0xE6, 0xB7,
2105 /* y */
2106 0x20, 0xD0, 0xAF, 0x89, 0x03, 0xA9, 0x6F, 0x8D, 0x5F, 0xA2, 0xC2, 0x55,
2107 0x74, 0x5D, 0x3C, 0x45, 0x1B, 0x30, 0x2C, 0x93, 0x46, 0xD9, 0xB7, 0xE4,
2108 0x85, 0xE7, 0xBC, 0xE4, 0x1F, 0x6B, 0x59, 0x1F, 0x3E, 0x8F, 0x6A, 0xDD,
2109 0xCB, 0xB0, 0xBC, 0x4C, 0x2F, 0x94, 0x7A, 0x7D, 0xE1, 0xA8, 0x9B, 0x62,
2110 0x5D, 0x6A, 0x59, 0x8B, 0x37, 0x60,
2111 /* order */
2112 0x00, 0x03, 0x40, 0x34, 0x03, 0x40, 0x34, 0x03, 0x40, 0x34, 0x03, 0x40,
2113 0x34, 0x03, 0x40, 0x34, 0x03, 0x40, 0x34, 0x03, 0x40, 0x34, 0x03, 0x40,
2114 0x34, 0x03, 0x40, 0x34, 0x03, 0x23, 0xC3, 0x13, 0xFA, 0xB5, 0x05, 0x89,
2115 0x70, 0x3B, 0x5E, 0xC6, 0x8D, 0x35, 0x87, 0xFE, 0xC6, 0x0D, 0x16, 0x1C,
2116 0xC1, 0x49, 0xC1, 0xAD, 0x4A, 0x91
2117 }
2118};
2119
2120static const struct {
2121 EC_CURVE_DATA h;
2122 unsigned char data[0 + 15 * 6];
2123} _EC_WTLS_1 = {
2124 {
2125 NID_X9_62_characteristic_two_field, 0, 15, 2
2126 },
2127 {
2128 /* no seed */
2129 /* p */
2130 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2131 0x00, 0x02, 0x01,
2132 /* a */
2133 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2134 0x00, 0x00, 0x01,
2135 /* b */
2136 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2137 0x00, 0x00, 0x01,
2138 /* x */
2139 0x01, 0x66, 0x79, 0x79, 0xA4, 0x0B, 0xA4, 0x97, 0xE5, 0xD5, 0xC2, 0x70,
2140 0x78, 0x06, 0x17,
2141 /* y */
2142 0x00, 0xF4, 0x4B, 0x4A, 0xF1, 0xEC, 0xC2, 0x63, 0x0E, 0x08, 0x78, 0x5C,
2143 0xEB, 0xCC, 0x15,
2144 /* order */
2145 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBF, 0x91, 0xAF,
2146 0x6D, 0xEA, 0x73
2147 }
2148};
2149
2150/* IPSec curves */
2151/*
2152 * NOTE: The of curves over a extension field of non prime degree is not
2153 * recommended (Weil-descent). As the group order is not a prime this curve
2154 * is not suitable for ECDSA.
2155 */
2156static const struct {
2157 EC_CURVE_DATA h;
2158 unsigned char data[0 + 20 * 6];
2159} _EC_IPSEC_155_ID3 = {
2160 {
2161 NID_X9_62_characteristic_two_field, 0, 20, 3
2162 },
2163 {
2164 /* no seed */
2165 /* p */
2166 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2167 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
2168 /* a */
2169 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2170 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2171 /* b */
2172 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2173 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x33, 0x8f,
2174 /* x */
2175 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2176 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b,
2177 /* y */
2178 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2179 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc8,
2180 /* order */
2181 0x02, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xC7, 0xF3,
2182 0xC7, 0x88, 0x1B, 0xD0, 0x86, 0x8F, 0xA8, 0x6C
2183 }
2184};
2185
2186/*
2187 * NOTE: The of curves over a extension field of non prime degree is not
2188 * recommended (Weil-descent). As the group order is not a prime this curve
2189 * is not suitable for ECDSA.
2190 */
2191static const struct {
2192 EC_CURVE_DATA h;
2193 unsigned char data[0 + 24 * 6];
2194} _EC_IPSEC_185_ID4 = {
2195 {
2196 NID_X9_62_characteristic_two_field, 0, 24, 2
2197 },
2198 {
2199 /* no seed */
2200 /* p */
2201 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2202 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
2203 /* a */
2204 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2205 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2206 /* b */
2207 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2208 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0xe9,
2209 /* x */
2210 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2211 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
2212 /* y */
2213 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2214 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d,
2215 /* order */
2216 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
2217 0xED, 0xF9, 0x7C, 0x44, 0xDB, 0x9F, 0x24, 0x20, 0xBA, 0xFC, 0xA7, 0x5E
2218 }
2219};
2220# endif /* FIPS_MODE */
2221#endif /* OPENSSL_NO_EC2M */
2222
2223/*
2224 * These curves were added by Annie Yousar.
2225 * For the definition of RFC 5639 curves see
2226 * http://www.ietf.org/rfc/rfc5639.txt These curves are generated verifiable
2227 * at random, nevertheless the seed is omitted as parameter because the
2228 * generation mechanism is different from those defined in ANSI X9.62.
2229 */
2230
2231#ifndef FIPS_MODE
2232static const struct {
2233 EC_CURVE_DATA h;
2234 unsigned char data[0 + 20 * 6];
2235} _EC_brainpoolP160r1 = {
2236 {
2237 NID_X9_62_prime_field, 0, 20, 1
2238 },
2239 {
2240 /* no seed */
2241 /* p */
2242 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD,
2243 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0F,
2244 /* a */
2245 0x34, 0x0E, 0x7B, 0xE2, 0xA2, 0x80, 0xEB, 0x74, 0xE2, 0xBE, 0x61, 0xBA,
2246 0xDA, 0x74, 0x5D, 0x97, 0xE8, 0xF7, 0xC3, 0x00,
2247 /* b */
2248 0x1E, 0x58, 0x9A, 0x85, 0x95, 0x42, 0x34, 0x12, 0x13, 0x4F, 0xAA, 0x2D,
2249 0xBD, 0xEC, 0x95, 0xC8, 0xD8, 0x67, 0x5E, 0x58,
2250 /* x */
2251 0xBE, 0xD5, 0xAF, 0x16, 0xEA, 0x3F, 0x6A, 0x4F, 0x62, 0x93, 0x8C, 0x46,
2252 0x31, 0xEB, 0x5A, 0xF7, 0xBD, 0xBC, 0xDB, 0xC3,
2253 /* y */
2254 0x16, 0x67, 0xCB, 0x47, 0x7A, 0x1A, 0x8E, 0xC3, 0x38, 0xF9, 0x47, 0x41,
2255 0x66, 0x9C, 0x97, 0x63, 0x16, 0xDA, 0x63, 0x21,
2256 /* order */
2257 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0x59, 0x91,
2258 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09
2259 }
2260};
2261
2262static const struct {
2263 EC_CURVE_DATA h;
2264 unsigned char data[0 + 20 * 6];
2265} _EC_brainpoolP160t1 = {
2266 {
2267 NID_X9_62_prime_field, 0, 20, 1
2268 },
2269 {
2270 /* no seed */
2271 /* p */
2272 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD,
2273 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0F,
2274 /* a */
2275 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD,
2276 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0C,
2277 /* b */
2278 0x7A, 0x55, 0x6B, 0x6D, 0xAE, 0x53, 0x5B, 0x7B, 0x51, 0xED, 0x2C, 0x4D,
2279 0x7D, 0xAA, 0x7A, 0x0B, 0x5C, 0x55, 0xF3, 0x80,
2280 /* x */
2281 0xB1, 0x99, 0xB1, 0x3B, 0x9B, 0x34, 0xEF, 0xC1, 0x39, 0x7E, 0x64, 0xBA,
2282 0xEB, 0x05, 0xAC, 0xC2, 0x65, 0xFF, 0x23, 0x78,
2283 /* y */
2284 0xAD, 0xD6, 0x71, 0x8B, 0x7C, 0x7C, 0x19, 0x61, 0xF0, 0x99, 0x1B, 0x84,
2285 0x24, 0x43, 0x77, 0x21, 0x52, 0xC9, 0xE0, 0xAD,
2286 /* order */
2287 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0x59, 0x91,
2288 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09
2289 }
2290};
2291
2292static const struct {
2293 EC_CURVE_DATA h;
2294 unsigned char data[0 + 24 * 6];
2295} _EC_brainpoolP192r1 = {
2296 {
2297 NID_X9_62_prime_field, 0, 24, 1
2298 },
2299 {
2300 /* no seed */
2301 /* p */
2302 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30,
2303 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x97,
2304 /* a */
2305 0x6A, 0x91, 0x17, 0x40, 0x76, 0xB1, 0xE0, 0xE1, 0x9C, 0x39, 0xC0, 0x31,
2306 0xFE, 0x86, 0x85, 0xC1, 0xCA, 0xE0, 0x40, 0xE5, 0xC6, 0x9A, 0x28, 0xEF,
2307 /* b */
2308 0x46, 0x9A, 0x28, 0xEF, 0x7C, 0x28, 0xCC, 0xA3, 0xDC, 0x72, 0x1D, 0x04,
2309 0x4F, 0x44, 0x96, 0xBC, 0xCA, 0x7E, 0xF4, 0x14, 0x6F, 0xBF, 0x25, 0xC9,
2310 /* x */
2311 0xC0, 0xA0, 0x64, 0x7E, 0xAA, 0xB6, 0xA4, 0x87, 0x53, 0xB0, 0x33, 0xC5,
2312 0x6C, 0xB0, 0xF0, 0x90, 0x0A, 0x2F, 0x5C, 0x48, 0x53, 0x37, 0x5F, 0xD6,
2313 /* y */
2314 0x14, 0xB6, 0x90, 0x86, 0x6A, 0xBD, 0x5B, 0xB8, 0x8B, 0x5F, 0x48, 0x28,
2315 0xC1, 0x49, 0x00, 0x02, 0xE6, 0x77, 0x3F, 0xA2, 0xFA, 0x29, 0x9B, 0x8F,
2316 /* order */
2317 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x2F,
2318 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1
2319 }
2320};
2321
2322static const struct {
2323 EC_CURVE_DATA h;
2324 unsigned char data[0 + 24 * 6];
2325} _EC_brainpoolP192t1 = {
2326 {
2327 NID_X9_62_prime_field, 0, 24, 1
2328 },
2329 {
2330 /* no seed */
2331 /* p */
2332 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30,
2333 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x97,
2334 /* a */
2335 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30,
2336 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x94,
2337 /* b */
2338 0x13, 0xD5, 0x6F, 0xFA, 0xEC, 0x78, 0x68, 0x1E, 0x68, 0xF9, 0xDE, 0xB4,
2339 0x3B, 0x35, 0xBE, 0xC2, 0xFB, 0x68, 0x54, 0x2E, 0x27, 0x89, 0x7B, 0x79,
2340 /* x */
2341 0x3A, 0xE9, 0xE5, 0x8C, 0x82, 0xF6, 0x3C, 0x30, 0x28, 0x2E, 0x1F, 0xE7,
2342 0xBB, 0xF4, 0x3F, 0xA7, 0x2C, 0x44, 0x6A, 0xF6, 0xF4, 0x61, 0x81, 0x29,
2343 /* y */
2344 0x09, 0x7E, 0x2C, 0x56, 0x67, 0xC2, 0x22, 0x3A, 0x90, 0x2A, 0xB5, 0xCA,
2345 0x44, 0x9D, 0x00, 0x84, 0xB7, 0xE5, 0xB3, 0xDE, 0x7C, 0xCC, 0x01, 0xC9,
2346 /* order */
2347 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x2F,
2348 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1
2349 }
2350};
2351
2352static const struct {
2353 EC_CURVE_DATA h;
2354 unsigned char data[0 + 28 * 6];
2355} _EC_brainpoolP224r1 = {
2356 {
2357 NID_X9_62_prime_field, 0, 28, 1
2358 },
2359 {
2360 /* no seed */
2361 /* p */
2362 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
2363 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5,
2364 0x7E, 0xC8, 0xC0, 0xFF,
2365 /* a */
2366 0x68, 0xA5, 0xE6, 0x2C, 0xA9, 0xCE, 0x6C, 0x1C, 0x29, 0x98, 0x03, 0xA6,
2367 0xC1, 0x53, 0x0B, 0x51, 0x4E, 0x18, 0x2A, 0xD8, 0xB0, 0x04, 0x2A, 0x59,
2368 0xCA, 0xD2, 0x9F, 0x43,
2369 /* b */
2370 0x25, 0x80, 0xF6, 0x3C, 0xCF, 0xE4, 0x41, 0x38, 0x87, 0x07, 0x13, 0xB1,
2371 0xA9, 0x23, 0x69, 0xE3, 0x3E, 0x21, 0x35, 0xD2, 0x66, 0xDB, 0xB3, 0x72,
2372 0x38, 0x6C, 0x40, 0x0B,
2373 /* x */
2374 0x0D, 0x90, 0x29, 0xAD, 0x2C, 0x7E, 0x5C, 0xF4, 0x34, 0x08, 0x23, 0xB2,
2375 0xA8, 0x7D, 0xC6, 0x8C, 0x9E, 0x4C, 0xE3, 0x17, 0x4C, 0x1E, 0x6E, 0xFD,
2376 0xEE, 0x12, 0xC0, 0x7D,
2377 /* y */
2378 0x58, 0xAA, 0x56, 0xF7, 0x72, 0xC0, 0x72, 0x6F, 0x24, 0xC6, 0xB8, 0x9E,
2379 0x4E, 0xCD, 0xAC, 0x24, 0x35, 0x4B, 0x9E, 0x99, 0xCA, 0xA3, 0xF6, 0xD3,
2380 0x76, 0x14, 0x02, 0xCD,
2381 /* order */
2382 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
2383 0x75, 0xD0, 0xFB, 0x98, 0xD1, 0x16, 0xBC, 0x4B, 0x6D, 0xDE, 0xBC, 0xA3,
2384 0xA5, 0xA7, 0x93, 0x9F
2385 }
2386};
2387
2388static const struct {
2389 EC_CURVE_DATA h;
2390 unsigned char data[0 + 28 * 6];
2391} _EC_brainpoolP224t1 = {
2392 {
2393 NID_X9_62_prime_field, 0, 28, 1
2394 },
2395 {
2396 /* no seed */
2397 /* p */
2398 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
2399 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5,
2400 0x7E, 0xC8, 0xC0, 0xFF,
2401 /* a */
2402 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
2403 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5,
2404 0x7E, 0xC8, 0xC0, 0xFC,
2405 /* b */
2406 0x4B, 0x33, 0x7D, 0x93, 0x41, 0x04, 0xCD, 0x7B, 0xEF, 0x27, 0x1B, 0xF6,
2407 0x0C, 0xED, 0x1E, 0xD2, 0x0D, 0xA1, 0x4C, 0x08, 0xB3, 0xBB, 0x64, 0xF1,
2408 0x8A, 0x60, 0x88, 0x8D,
2409 /* x */
2410 0x6A, 0xB1, 0xE3, 0x44, 0xCE, 0x25, 0xFF, 0x38, 0x96, 0x42, 0x4E, 0x7F,
2411 0xFE, 0x14, 0x76, 0x2E, 0xCB, 0x49, 0xF8, 0x92, 0x8A, 0xC0, 0xC7, 0x60,
2412 0x29, 0xB4, 0xD5, 0x80,
2413 /* y */
2414 0x03, 0x74, 0xE9, 0xF5, 0x14, 0x3E, 0x56, 0x8C, 0xD2, 0x3F, 0x3F, 0x4D,
2415 0x7C, 0x0D, 0x4B, 0x1E, 0x41, 0xC8, 0xCC, 0x0D, 0x1C, 0x6A, 0xBD, 0x5F,
2416 0x1A, 0x46, 0xDB, 0x4C,
2417 /* order */
2418 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
2419 0x75, 0xD0, 0xFB, 0x98, 0xD1, 0x16, 0xBC, 0x4B, 0x6D, 0xDE, 0xBC, 0xA3,
2420 0xA5, 0xA7, 0x93, 0x9F
2421 }
2422};
2423
2424static const struct {
2425 EC_CURVE_DATA h;
2426 unsigned char data[0 + 32 * 6];
2427} _EC_brainpoolP256r1 = {
2428 {
2429 NID_X9_62_prime_field, 0, 32, 1
2430 },
2431 {
2432 /* no seed */
2433 /* p */
2434 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
2435 0x9D, 0x83, 0x8D, 0x72, 0x6E, 0x3B, 0xF6, 0x23, 0xD5, 0x26, 0x20, 0x28,
2436 0x20, 0x13, 0x48, 0x1D, 0x1F, 0x6E, 0x53, 0x77,
2437 /* a */
2438 0x7D, 0x5A, 0x09, 0x75, 0xFC, 0x2C, 0x30, 0x57, 0xEE, 0xF6, 0x75, 0x30,
2439 0x41, 0x7A, 0xFF, 0xE7, 0xFB, 0x80, 0x55, 0xC1, 0x26, 0xDC, 0x5C, 0x6C,
2440 0xE9, 0x4A, 0x4B, 0x44, 0xF3, 0x30, 0xB5, 0xD9,
2441 /* b */
2442 0x26, 0xDC, 0x5C, 0x6C, 0xE9, 0x4A, 0x4B, 0x44, 0xF3, 0x30, 0xB5, 0xD9,
2443 0xBB, 0xD7, 0x7C, 0xBF, 0x95, 0x84, 0x16, 0x29, 0x5C, 0xF7, 0xE1, 0xCE,
2444 0x6B, 0xCC, 0xDC, 0x18, 0xFF, 0x8C, 0x07, 0xB6,
2445 /* x */
2446 0x8B, 0xD2, 0xAE, 0xB9, 0xCB, 0x7E, 0x57, 0xCB, 0x2C, 0x4B, 0x48, 0x2F,
2447 0xFC, 0x81, 0xB7, 0xAF, 0xB9, 0xDE, 0x27, 0xE1, 0xE3, 0xBD, 0x23, 0xC2,
2448 0x3A, 0x44, 0x53, 0xBD, 0x9A, 0xCE, 0x32, 0x62,
2449 /* y */
2450 0x54, 0x7E, 0xF8, 0x35, 0xC3, 0xDA, 0xC4, 0xFD, 0x97, 0xF8, 0x46, 0x1A,
2451 0x14, 0x61, 0x1D, 0xC9, 0xC2, 0x77, 0x45, 0x13, 0x2D, 0xED, 0x8E, 0x54,
2452 0x5C, 0x1D, 0x54, 0xC7, 0x2F, 0x04, 0x69, 0x97,
2453 /* order */
2454 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
2455 0x9D, 0x83, 0x8D, 0x71, 0x8C, 0x39, 0x7A, 0xA3, 0xB5, 0x61, 0xA6, 0xF7,
2456 0x90, 0x1E, 0x0E, 0x82, 0x97, 0x48, 0x56, 0xA7
2457 }
2458};
2459
2460static const struct {
2461 EC_CURVE_DATA h;
2462 unsigned char data[0 + 32 * 6];
2463} _EC_brainpoolP256t1 = {
2464 {
2465 NID_X9_62_prime_field, 0, 32, 1
2466 },
2467 {
2468 /* no seed */
2469 /* p */
2470 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
2471 0x9D, 0x83, 0x8D, 0x72, 0x6E, 0x3B, 0xF6, 0x23, 0xD5, 0x26, 0x20, 0x28,
2472 0x20, 0x13, 0x48, 0x1D, 0x1F, 0x6E, 0x53, 0x77,
2473 /* a */
2474 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
2475 0x9D, 0x83, 0x8D, 0x72, 0x6E, 0x3B, 0xF6, 0x23, 0xD5, 0x26, 0x20, 0x28,
2476 0x20, 0x13, 0x48, 0x1D, 0x1F, 0x6E, 0x53, 0x74,
2477 /* b */
2478 0x66, 0x2C, 0x61, 0xC4, 0x30, 0xD8, 0x4E, 0xA4, 0xFE, 0x66, 0xA7, 0x73,
2479 0x3D, 0x0B, 0x76, 0xB7, 0xBF, 0x93, 0xEB, 0xC4, 0xAF, 0x2F, 0x49, 0x25,
2480 0x6A, 0xE5, 0x81, 0x01, 0xFE, 0xE9, 0x2B, 0x04,
2481 /* x */
2482 0xA3, 0xE8, 0xEB, 0x3C, 0xC1, 0xCF, 0xE7, 0xB7, 0x73, 0x22, 0x13, 0xB2,
2483 0x3A, 0x65, 0x61, 0x49, 0xAF, 0xA1, 0x42, 0xC4, 0x7A, 0xAF, 0xBC, 0x2B,
2484 0x79, 0xA1, 0x91, 0x56, 0x2E, 0x13, 0x05, 0xF4,
2485 /* y */
2486 0x2D, 0x99, 0x6C, 0x82, 0x34, 0x39, 0xC5, 0x6D, 0x7F, 0x7B, 0x22, 0xE1,
2487 0x46, 0x44, 0x41, 0x7E, 0x69, 0xBC, 0xB6, 0xDE, 0x39, 0xD0, 0x27, 0x00,
2488 0x1D, 0xAB, 0xE8, 0xF3, 0x5B, 0x25, 0xC9, 0xBE,
2489 /* order */
2490 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
2491 0x9D, 0x83, 0x8D, 0x71, 0x8C, 0x39, 0x7A, 0xA3, 0xB5, 0x61, 0xA6, 0xF7,
2492 0x90, 0x1E, 0x0E, 0x82, 0x97, 0x48, 0x56, 0xA7
2493 }
2494};
2495
2496static const struct {
2497 EC_CURVE_DATA h;
2498 unsigned char data[0 + 40 * 6];
2499} _EC_brainpoolP320r1 = {
2500 {
2501 NID_X9_62_prime_field, 0, 40, 1
2502 },
2503 {
2504 /* no seed */
2505 /* p */
2506 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
2507 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA6, 0xF6, 0xF4, 0x0D, 0xEF,
2508 0x4F, 0x92, 0xB9, 0xEC, 0x78, 0x93, 0xEC, 0x28, 0xFC, 0xD4, 0x12, 0xB1,
2509 0xF1, 0xB3, 0x2E, 0x27,
2510 /* a */
2511 0x3E, 0xE3, 0x0B, 0x56, 0x8F, 0xBA, 0xB0, 0xF8, 0x83, 0xCC, 0xEB, 0xD4,
2512 0x6D, 0x3F, 0x3B, 0xB8, 0xA2, 0xA7, 0x35, 0x13, 0xF5, 0xEB, 0x79, 0xDA,
2513 0x66, 0x19, 0x0E, 0xB0, 0x85, 0xFF, 0xA9, 0xF4, 0x92, 0xF3, 0x75, 0xA9,
2514 0x7D, 0x86, 0x0E, 0xB4,
2515 /* b */
2516 0x52, 0x08, 0x83, 0x94, 0x9D, 0xFD, 0xBC, 0x42, 0xD3, 0xAD, 0x19, 0x86,
2517 0x40, 0x68, 0x8A, 0x6F, 0xE1, 0x3F, 0x41, 0x34, 0x95, 0x54, 0xB4, 0x9A,
2518 0xCC, 0x31, 0xDC, 0xCD, 0x88, 0x45, 0x39, 0x81, 0x6F, 0x5E, 0xB4, 0xAC,
2519 0x8F, 0xB1, 0xF1, 0xA6,
2520 /* x */
2521 0x43, 0xBD, 0x7E, 0x9A, 0xFB, 0x53, 0xD8, 0xB8, 0x52, 0x89, 0xBC, 0xC4,
2522 0x8E, 0xE5, 0xBF, 0xE6, 0xF2, 0x01, 0x37, 0xD1, 0x0A, 0x08, 0x7E, 0xB6,
2523 0xE7, 0x87, 0x1E, 0x2A, 0x10, 0xA5, 0x99, 0xC7, 0x10, 0xAF, 0x8D, 0x0D,
2524 0x39, 0xE2, 0x06, 0x11,
2525 /* y */
2526 0x14, 0xFD, 0xD0, 0x55, 0x45, 0xEC, 0x1C, 0xC8, 0xAB, 0x40, 0x93, 0x24,
2527 0x7F, 0x77, 0x27, 0x5E, 0x07, 0x43, 0xFF, 0xED, 0x11, 0x71, 0x82, 0xEA,
2528 0xA9, 0xC7, 0x78, 0x77, 0xAA, 0xAC, 0x6A, 0xC7, 0xD3, 0x52, 0x45, 0xD1,
2529 0x69, 0x2E, 0x8E, 0xE1,
2530 /* order */
2531 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
2532 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA5, 0xB6, 0x8F, 0x12, 0xA3,
2533 0x2D, 0x48, 0x2E, 0xC7, 0xEE, 0x86, 0x58, 0xE9, 0x86, 0x91, 0x55, 0x5B,
2534 0x44, 0xC5, 0x93, 0x11
2535 }
2536};
2537
2538static const struct {
2539 EC_CURVE_DATA h;
2540 unsigned char data[0 + 40 * 6];
2541} _EC_brainpoolP320t1 = {
2542 {
2543 NID_X9_62_prime_field, 0, 40, 1
2544 },
2545 {
2546 /* no seed */
2547 /* p */
2548 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
2549 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA6, 0xF6, 0xF4, 0x0D, 0xEF,
2550 0x4F, 0x92, 0xB9, 0xEC, 0x78, 0x93, 0xEC, 0x28, 0xFC, 0xD4, 0x12, 0xB1,
2551 0xF1, 0xB3, 0x2E, 0x27,
2552 /* a */
2553 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
2554 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA6, 0xF6, 0xF4, 0x0D, 0xEF,
2555 0x4F, 0x92, 0xB9, 0xEC, 0x78, 0x93, 0xEC, 0x28, 0xFC, 0xD4, 0x12, 0xB1,
2556 0xF1, 0xB3, 0x2E, 0x24,
2557 /* b */
2558 0xA7, 0xF5, 0x61, 0xE0, 0x38, 0xEB, 0x1E, 0xD5, 0x60, 0xB3, 0xD1, 0x47,
2559 0xDB, 0x78, 0x20, 0x13, 0x06, 0x4C, 0x19, 0xF2, 0x7E, 0xD2, 0x7C, 0x67,
2560 0x80, 0xAA, 0xF7, 0x7F, 0xB8, 0xA5, 0x47, 0xCE, 0xB5, 0xB4, 0xFE, 0xF4,
2561 0x22, 0x34, 0x03, 0x53,
2562 /* x */
2563 0x92, 0x5B, 0xE9, 0xFB, 0x01, 0xAF, 0xC6, 0xFB, 0x4D, 0x3E, 0x7D, 0x49,
2564 0x90, 0x01, 0x0F, 0x81, 0x34, 0x08, 0xAB, 0x10, 0x6C, 0x4F, 0x09, 0xCB,
2565 0x7E, 0xE0, 0x78, 0x68, 0xCC, 0x13, 0x6F, 0xFF, 0x33, 0x57, 0xF6, 0x24,
2566 0xA2, 0x1B, 0xED, 0x52,
2567 /* y */
2568 0x63, 0xBA, 0x3A, 0x7A, 0x27, 0x48, 0x3E, 0xBF, 0x66, 0x71, 0xDB, 0xEF,
2569 0x7A, 0xBB, 0x30, 0xEB, 0xEE, 0x08, 0x4E, 0x58, 0xA0, 0xB0, 0x77, 0xAD,
2570 0x42, 0xA5, 0xA0, 0x98, 0x9D, 0x1E, 0xE7, 0x1B, 0x1B, 0x9B, 0xC0, 0x45,
2571 0x5F, 0xB0, 0xD2, 0xC3,
2572 /* order */
2573 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
2574 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA5, 0xB6, 0x8F, 0x12, 0xA3,
2575 0x2D, 0x48, 0x2E, 0xC7, 0xEE, 0x86, 0x58, 0xE9, 0x86, 0x91, 0x55, 0x5B,
2576 0x44, 0xC5, 0x93, 0x11
2577 }
2578};
2579
2580static const struct {
2581 EC_CURVE_DATA h;
2582 unsigned char data[0 + 48 * 6];
2583} _EC_brainpoolP384r1 = {
2584 {
2585 NID_X9_62_prime_field, 0, 48, 1
2586 },
2587 {
2588 /* no seed */
2589 /* p */
2590 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
2591 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB4,
2592 0x12, 0xB1, 0xDA, 0x19, 0x7F, 0xB7, 0x11, 0x23, 0xAC, 0xD3, 0xA7, 0x29,
2593 0x90, 0x1D, 0x1A, 0x71, 0x87, 0x47, 0x00, 0x13, 0x31, 0x07, 0xEC, 0x53,
2594 /* a */
2595 0x7B, 0xC3, 0x82, 0xC6, 0x3D, 0x8C, 0x15, 0x0C, 0x3C, 0x72, 0x08, 0x0A,
2596 0xCE, 0x05, 0xAF, 0xA0, 0xC2, 0xBE, 0xA2, 0x8E, 0x4F, 0xB2, 0x27, 0x87,
2597 0x13, 0x91, 0x65, 0xEF, 0xBA, 0x91, 0xF9, 0x0F, 0x8A, 0xA5, 0x81, 0x4A,
2598 0x50, 0x3A, 0xD4, 0xEB, 0x04, 0xA8, 0xC7, 0xDD, 0x22, 0xCE, 0x28, 0x26,
2599 /* b */
2600 0x04, 0xA8, 0xC7, 0xDD, 0x22, 0xCE, 0x28, 0x26, 0x8B, 0x39, 0xB5, 0x54,
2601 0x16, 0xF0, 0x44, 0x7C, 0x2F, 0xB7, 0x7D, 0xE1, 0x07, 0xDC, 0xD2, 0xA6,
2602 0x2E, 0x88, 0x0E, 0xA5, 0x3E, 0xEB, 0x62, 0xD5, 0x7C, 0xB4, 0x39, 0x02,
2603 0x95, 0xDB, 0xC9, 0x94, 0x3A, 0xB7, 0x86, 0x96, 0xFA, 0x50, 0x4C, 0x11,
2604 /* x */
2605 0x1D, 0x1C, 0x64, 0xF0, 0x68, 0xCF, 0x45, 0xFF, 0xA2, 0xA6, 0x3A, 0x81,
2606 0xB7, 0xC1, 0x3F, 0x6B, 0x88, 0x47, 0xA3, 0xE7, 0x7E, 0xF1, 0x4F, 0xE3,
2607 0xDB, 0x7F, 0xCA, 0xFE, 0x0C, 0xBD, 0x10, 0xE8, 0xE8, 0x26, 0xE0, 0x34,
2608 0x36, 0xD6, 0x46, 0xAA, 0xEF, 0x87, 0xB2, 0xE2, 0x47, 0xD4, 0xAF, 0x1E,
2609 /* y */
2610 0x8A, 0xBE, 0x1D, 0x75, 0x20, 0xF9, 0xC2, 0xA4, 0x5C, 0xB1, 0xEB, 0x8E,
2611 0x95, 0xCF, 0xD5, 0x52, 0x62, 0xB7, 0x0B, 0x29, 0xFE, 0xEC, 0x58, 0x64,
2612 0xE1, 0x9C, 0x05, 0x4F, 0xF9, 0x91, 0x29, 0x28, 0x0E, 0x46, 0x46, 0x21,
2613 0x77, 0x91, 0x81, 0x11, 0x42, 0x82, 0x03, 0x41, 0x26, 0x3C, 0x53, 0x15,
2614 /* order */
2615 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
2616 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB3,
2617 0x1F, 0x16, 0x6E, 0x6C, 0xAC, 0x04, 0x25, 0xA7, 0xCF, 0x3A, 0xB6, 0xAF,
2618 0x6B, 0x7F, 0xC3, 0x10, 0x3B, 0x88, 0x32, 0x02, 0xE9, 0x04, 0x65, 0x65
2619 }
2620};
2621
2622static const struct {
2623 EC_CURVE_DATA h;
2624 unsigned char data[0 + 48 * 6];
2625} _EC_brainpoolP384t1 = {
2626 {
2627 NID_X9_62_prime_field, 0, 48, 1
2628 },
2629 {
2630 /* no seed */
2631 /* p */
2632 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
2633 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB4,
2634 0x12, 0xB1, 0xDA, 0x19, 0x7F, 0xB7, 0x11, 0x23, 0xAC, 0xD3, 0xA7, 0x29,
2635 0x90, 0x1D, 0x1A, 0x71, 0x87, 0x47, 0x00, 0x13, 0x31, 0x07, 0xEC, 0x53,
2636 /* a */
2637 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
2638 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB4,
2639 0x12, 0xB1, 0xDA, 0x19, 0x7F, 0xB7, 0x11, 0x23, 0xAC, 0xD3, 0xA7, 0x29,
2640 0x90, 0x1D, 0x1A, 0x71, 0x87, 0x47, 0x00, 0x13, 0x31, 0x07, 0xEC, 0x50,
2641 /* b */
2642 0x7F, 0x51, 0x9E, 0xAD, 0xA7, 0xBD, 0xA8, 0x1B, 0xD8, 0x26, 0xDB, 0xA6,
2643 0x47, 0x91, 0x0F, 0x8C, 0x4B, 0x93, 0x46, 0xED, 0x8C, 0xCD, 0xC6, 0x4E,
2644 0x4B, 0x1A, 0xBD, 0x11, 0x75, 0x6D, 0xCE, 0x1D, 0x20, 0x74, 0xAA, 0x26,
2645 0x3B, 0x88, 0x80, 0x5C, 0xED, 0x70, 0x35, 0x5A, 0x33, 0xB4, 0x71, 0xEE,
2646 /* x */
2647 0x18, 0xDE, 0x98, 0xB0, 0x2D, 0xB9, 0xA3, 0x06, 0xF2, 0xAF, 0xCD, 0x72,
2648 0x35, 0xF7, 0x2A, 0x81, 0x9B, 0x80, 0xAB, 0x12, 0xEB, 0xD6, 0x53, 0x17,
2649 0x24, 0x76, 0xFE, 0xCD, 0x46, 0x2A, 0xAB, 0xFF, 0xC4, 0xFF, 0x19, 0x1B,
2650 0x94, 0x6A, 0x5F, 0x54, 0xD8, 0xD0, 0xAA, 0x2F, 0x41, 0x88, 0x08, 0xCC,
2651 /* y */
2652 0x25, 0xAB, 0x05, 0x69, 0x62, 0xD3, 0x06, 0x51, 0xA1, 0x14, 0xAF, 0xD2,
2653 0x75, 0x5A, 0xD3, 0x36, 0x74, 0x7F, 0x93, 0x47, 0x5B, 0x7A, 0x1F, 0xCA,
2654 0x3B, 0x88, 0xF2, 0xB6, 0xA2, 0x08, 0xCC, 0xFE, 0x46, 0x94, 0x08, 0x58,
2655 0x4D, 0xC2, 0xB2, 0x91, 0x26, 0x75, 0xBF, 0x5B, 0x9E, 0x58, 0x29, 0x28,
2656 /* order */
2657 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
2658 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB3,
2659 0x1F, 0x16, 0x6E, 0x6C, 0xAC, 0x04, 0x25, 0xA7, 0xCF, 0x3A, 0xB6, 0xAF,
2660 0x6B, 0x7F, 0xC3, 0x10, 0x3B, 0x88, 0x32, 0x02, 0xE9, 0x04, 0x65, 0x65
2661 }
2662};
2663
2664static const struct {
2665 EC_CURVE_DATA h;
2666 unsigned char data[0 + 64 * 6];
2667} _EC_brainpoolP512r1 = {
2668 {
2669 NID_X9_62_prime_field, 0, 64, 1
2670 },
2671 {
2672 /* no seed */
2673 /* p */
2674 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
2675 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
2676 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x71, 0x7D, 0x4D, 0x9B, 0x00,
2677 0x9B, 0xC6, 0x68, 0x42, 0xAE, 0xCD, 0xA1, 0x2A, 0xE6, 0xA3, 0x80, 0xE6,
2678 0x28, 0x81, 0xFF, 0x2F, 0x2D, 0x82, 0xC6, 0x85, 0x28, 0xAA, 0x60, 0x56,
2679 0x58, 0x3A, 0x48, 0xF3,
2680 /* a */
2681 0x78, 0x30, 0xA3, 0x31, 0x8B, 0x60, 0x3B, 0x89, 0xE2, 0x32, 0x71, 0x45,
2682 0xAC, 0x23, 0x4C, 0xC5, 0x94, 0xCB, 0xDD, 0x8D, 0x3D, 0xF9, 0x16, 0x10,
2683 0xA8, 0x34, 0x41, 0xCA, 0xEA, 0x98, 0x63, 0xBC, 0x2D, 0xED, 0x5D, 0x5A,
2684 0xA8, 0x25, 0x3A, 0xA1, 0x0A, 0x2E, 0xF1, 0xC9, 0x8B, 0x9A, 0xC8, 0xB5,
2685 0x7F, 0x11, 0x17, 0xA7, 0x2B, 0xF2, 0xC7, 0xB9, 0xE7, 0xC1, 0xAC, 0x4D,
2686 0x77, 0xFC, 0x94, 0xCA,
2687 /* b */
2688 0x3D, 0xF9, 0x16, 0x10, 0xA8, 0x34, 0x41, 0xCA, 0xEA, 0x98, 0x63, 0xBC,
2689 0x2D, 0xED, 0x5D, 0x5A, 0xA8, 0x25, 0x3A, 0xA1, 0x0A, 0x2E, 0xF1, 0xC9,
2690 0x8B, 0x9A, 0xC8, 0xB5, 0x7F, 0x11, 0x17, 0xA7, 0x2B, 0xF2, 0xC7, 0xB9,
2691 0xE7, 0xC1, 0xAC, 0x4D, 0x77, 0xFC, 0x94, 0xCA, 0xDC, 0x08, 0x3E, 0x67,
2692 0x98, 0x40, 0x50, 0xB7, 0x5E, 0xBA, 0xE5, 0xDD, 0x28, 0x09, 0xBD, 0x63,
2693 0x80, 0x16, 0xF7, 0x23,
2694 /* x */
2695 0x81, 0xAE, 0xE4, 0xBD, 0xD8, 0x2E, 0xD9, 0x64, 0x5A, 0x21, 0x32, 0x2E,
2696 0x9C, 0x4C, 0x6A, 0x93, 0x85, 0xED, 0x9F, 0x70, 0xB5, 0xD9, 0x16, 0xC1,
2697 0xB4, 0x3B, 0x62, 0xEE, 0xF4, 0xD0, 0x09, 0x8E, 0xFF, 0x3B, 0x1F, 0x78,
2698 0xE2, 0xD0, 0xD4, 0x8D, 0x50, 0xD1, 0x68, 0x7B, 0x93, 0xB9, 0x7D, 0x5F,
2699 0x7C, 0x6D, 0x50, 0x47, 0x40, 0x6A, 0x5E, 0x68, 0x8B, 0x35, 0x22, 0x09,
2700 0xBC, 0xB9, 0xF8, 0x22,
2701 /* y */
2702 0x7D, 0xDE, 0x38, 0x5D, 0x56, 0x63, 0x32, 0xEC, 0xC0, 0xEA, 0xBF, 0xA9,
2703 0xCF, 0x78, 0x22, 0xFD, 0xF2, 0x09, 0xF7, 0x00, 0x24, 0xA5, 0x7B, 0x1A,
2704 0xA0, 0x00, 0xC5, 0x5B, 0x88, 0x1F, 0x81, 0x11, 0xB2, 0xDC, 0xDE, 0x49,
2705 0x4A, 0x5F, 0x48, 0x5E, 0x5B, 0xCA, 0x4B, 0xD8, 0x8A, 0x27, 0x63, 0xAE,
2706 0xD1, 0xCA, 0x2B, 0x2F, 0xA8, 0xF0, 0x54, 0x06, 0x78, 0xCD, 0x1E, 0x0F,
2707 0x3A, 0xD8, 0x08, 0x92,
2708 /* order */
2709 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
2710 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
2711 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x70, 0x55, 0x3E, 0x5C, 0x41,
2712 0x4C, 0xA9, 0x26, 0x19, 0x41, 0x86, 0x61, 0x19, 0x7F, 0xAC, 0x10, 0x47,
2713 0x1D, 0xB1, 0xD3, 0x81, 0x08, 0x5D, 0xDA, 0xDD, 0xB5, 0x87, 0x96, 0x82,
2714 0x9C, 0xA9, 0x00, 0x69
2715 }
2716};
2717
2718static const struct {
2719 EC_CURVE_DATA h;
2720 unsigned char data[0 + 64 * 6];
2721} _EC_brainpoolP512t1 = {
2722 {
2723 NID_X9_62_prime_field, 0, 64, 1
2724 },
2725 {
2726 /* no seed */
2727 /* p */
2728 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
2729 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
2730 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x71, 0x7D, 0x4D, 0x9B, 0x00,
2731 0x9B, 0xC6, 0x68, 0x42, 0xAE, 0xCD, 0xA1, 0x2A, 0xE6, 0xA3, 0x80, 0xE6,
2732 0x28, 0x81, 0xFF, 0x2F, 0x2D, 0x82, 0xC6, 0x85, 0x28, 0xAA, 0x60, 0x56,
2733 0x58, 0x3A, 0x48, 0xF3,
2734 /* a */
2735 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
2736 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
2737 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x71, 0x7D, 0x4D, 0x9B, 0x00,
2738 0x9B, 0xC6, 0x68, 0x42, 0xAE, 0xCD, 0xA1, 0x2A, 0xE6, 0xA3, 0x80, 0xE6,
2739 0x28, 0x81, 0xFF, 0x2F, 0x2D, 0x82, 0xC6, 0x85, 0x28, 0xAA, 0x60, 0x56,
2740 0x58, 0x3A, 0x48, 0xF0,
2741 /* b */
2742 0x7C, 0xBB, 0xBC, 0xF9, 0x44, 0x1C, 0xFA, 0xB7, 0x6E, 0x18, 0x90, 0xE4,
2743 0x68, 0x84, 0xEA, 0xE3, 0x21, 0xF7, 0x0C, 0x0B, 0xCB, 0x49, 0x81, 0x52,
2744 0x78, 0x97, 0x50, 0x4B, 0xEC, 0x3E, 0x36, 0xA6, 0x2B, 0xCD, 0xFA, 0x23,
2745 0x04, 0x97, 0x65, 0x40, 0xF6, 0x45, 0x00, 0x85, 0xF2, 0xDA, 0xE1, 0x45,
2746 0xC2, 0x25, 0x53, 0xB4, 0x65, 0x76, 0x36, 0x89, 0x18, 0x0E, 0xA2, 0x57,
2747 0x18, 0x67, 0x42, 0x3E,
2748 /* x */
2749 0x64, 0x0E, 0xCE, 0x5C, 0x12, 0x78, 0x87, 0x17, 0xB9, 0xC1, 0xBA, 0x06,
2750 0xCB, 0xC2, 0xA6, 0xFE, 0xBA, 0x85, 0x84, 0x24, 0x58, 0xC5, 0x6D, 0xDE,
2751 0x9D, 0xB1, 0x75, 0x8D, 0x39, 0xC0, 0x31, 0x3D, 0x82, 0xBA, 0x51, 0x73,
2752 0x5C, 0xDB, 0x3E, 0xA4, 0x99, 0xAA, 0x77, 0xA7, 0xD6, 0x94, 0x3A, 0x64,
2753 0xF7, 0xA3, 0xF2, 0x5F, 0xE2, 0x6F, 0x06, 0xB5, 0x1B, 0xAA, 0x26, 0x96,
2754 0xFA, 0x90, 0x35, 0xDA,
2755 /* y */
2756 0x5B, 0x53, 0x4B, 0xD5, 0x95, 0xF5, 0xAF, 0x0F, 0xA2, 0xC8, 0x92, 0x37,
2757 0x6C, 0x84, 0xAC, 0xE1, 0xBB, 0x4E, 0x30, 0x19, 0xB7, 0x16, 0x34, 0xC0,
2758 0x11, 0x31, 0x15, 0x9C, 0xAE, 0x03, 0xCE, 0xE9, 0xD9, 0x93, 0x21, 0x84,
2759 0xBE, 0xEF, 0x21, 0x6B, 0xD7, 0x1D, 0xF2, 0xDA, 0xDF, 0x86, 0xA6, 0x27,
2760 0x30, 0x6E, 0xCF, 0xF9, 0x6D, 0xBB, 0x8B, 0xAC, 0xE1, 0x98, 0xB6, 0x1E,
2761 0x00, 0xF8, 0xB3, 0x32,
2762 /* order */
2763 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
2764 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
2765 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x70, 0x55, 0x3E, 0x5C, 0x41,
2766 0x4C, 0xA9, 0x26, 0x19, 0x41, 0x86, 0x61, 0x19, 0x7F, 0xAC, 0x10, 0x47,
2767 0x1D, 0xB1, 0xD3, 0x81, 0x08, 0x5D, 0xDA, 0xDD, 0xB5, 0x87, 0x96, 0x82,
2768 0x9C, 0xA9, 0x00, 0x69
2769 }
2770};
2771#endif /* FIPS_MODE */
2772
2773#if !defined(OPENSSL_NO_SM2) && !defined(FIPS_MODE)
2774static const struct {
2775 EC_CURVE_DATA h;
2776 unsigned char data[0 + 32 * 6];
2777} _EC_sm2p256v1 = {
2778 {
2779 NID_X9_62_prime_field, 0, 32, 1
2780 },
2781 {
2782 /* no seed */
2783
2784 /* p */
2785 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2786 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
2787 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2788 /* a */
2789 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2790 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
2791 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
2792 /* b */
2793 0x28, 0xe9, 0xfa, 0x9e, 0x9d, 0x9f, 0x5e, 0x34, 0x4d, 0x5a, 0x9e, 0x4b,
2794 0xcf, 0x65, 0x09, 0xa7, 0xf3, 0x97, 0x89, 0xf5, 0x15, 0xab, 0x8f, 0x92,
2795 0xdd, 0xbc, 0xbd, 0x41, 0x4d, 0x94, 0x0e, 0x93,
2796 /* x */
2797 0x32, 0xc4, 0xae, 0x2c, 0x1f, 0x19, 0x81, 0x19, 0x5f, 0x99, 0x04, 0x46,
2798 0x6a, 0x39, 0xc9, 0x94, 0x8f, 0xe3, 0x0b, 0xbf, 0xf2, 0x66, 0x0b, 0xe1,
2799 0x71, 0x5a, 0x45, 0x89, 0x33, 0x4c, 0x74, 0xc7,
2800 /* y */
2801 0xbc, 0x37, 0x36, 0xa2, 0xf4, 0xf6, 0x77, 0x9c, 0x59, 0xbd, 0xce, 0xe3,
2802 0x6b, 0x69, 0x21, 0x53, 0xd0, 0xa9, 0x87, 0x7c, 0xc6, 0x2a, 0x47, 0x40,
2803 0x02, 0xdf, 0x32, 0xe5, 0x21, 0x39, 0xf0, 0xa0,
2804 /* order */
2805 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2806 0xff, 0xff, 0xff, 0xff, 0x72, 0x03, 0xdf, 0x6b, 0x21, 0xc6, 0x05, 0x2b,
2807 0x53, 0xbb, 0xf4, 0x09, 0x39, 0xd5, 0x41, 0x23,
2808 }
2809};
2810#endif /* OPENSSL_NO_SM2 */
2811
2812typedef struct _ec_list_element_st {
2813 int nid;
2814 const EC_CURVE_DATA *data;
2815 const EC_METHOD *(*meth) (void);
2816 const char *comment;
2817} ec_list_element;
2818
2819#ifdef FIPS_MODE
2820static const ec_list_element curve_list[] = {
2821 /* prime field curves */
2822 /* secg curves */
2823# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
2824 {NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method,
2825 "NIST/SECG curve over a 224 bit prime field"},
2826# else
2827 {NID_secp224r1, &_EC_NIST_PRIME_224.h, 0,
2828 "NIST/SECG curve over a 224 bit prime field"},
2829# endif
2830 /* SECG secp256r1 is the same as X9.62 prime256v1 and hence omitted */
2831 {NID_secp384r1, &_EC_NIST_PRIME_384.h,
2832# if defined(S390X_EC_ASM)
2833 EC_GFp_s390x_nistp384_method,
2834# else
2835 0,
2836# endif
2837 "NIST/SECG curve over a 384 bit prime field"},
2838
2839 {NID_secp521r1, &_EC_NIST_PRIME_521.h,
2840# if defined(S390X_EC_ASM)
2841 EC_GFp_s390x_nistp521_method,
2842# elif !defined(OPENSSL_NO_EC_NISTP_64_GCC_128)
2843 EC_GFp_nistp521_method,
2844# else
2845 0,
2846# endif
2847 "NIST/SECG curve over a 521 bit prime field"},
2848
2849 /* X9.62 curves */
2850 {NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0,
2851 "NIST/X9.62/SECG curve over a 192 bit prime field"},
2852 {NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h,
2853# if defined(ECP_NISTZ256_ASM)
2854 EC_GFp_nistz256_method,
2855# elif defined(S390X_EC_ASM)
2856 EC_GFp_s390x_nistp256_method,
2857# elif !defined(OPENSSL_NO_EC_NISTP_64_GCC_128)
2858 EC_GFp_nistp256_method,
2859# else
2860 0,
2861# endif
2862 "X9.62/SECG curve over a 256 bit prime field"},
2863
2864# ifndef OPENSSL_NO_EC2M
2865 /* characteristic two field curves */
2866 /* NIST/SECG curves */
2867 {NID_sect163k1, &_EC_NIST_CHAR2_163K.h, 0,
2868 "NIST/SECG/WTLS curve over a 163 bit binary field"},
2869 {NID_sect163r2, &_EC_NIST_CHAR2_163B.h, 0,
2870 "NIST/SECG curve over a 163 bit binary field"},
2871 {NID_sect233k1, &_EC_NIST_CHAR2_233K.h, 0,
2872 "NIST/SECG/WTLS curve over a 233 bit binary field"},
2873 {NID_sect233r1, &_EC_NIST_CHAR2_233B.h, 0,
2874 "NIST/SECG/WTLS curve over a 233 bit binary field"},
2875 {NID_sect283k1, &_EC_NIST_CHAR2_283K.h, 0,
2876 "NIST/SECG curve over a 283 bit binary field"},
2877 {NID_sect283r1, &_EC_NIST_CHAR2_283B.h, 0,
2878 "NIST/SECG curve over a 283 bit binary field"},
2879 {NID_sect409k1, &_EC_NIST_CHAR2_409K.h, 0,
2880 "NIST/SECG curve over a 409 bit binary field"},
2881 {NID_sect409r1, &_EC_NIST_CHAR2_409B.h, 0,
2882 "NIST/SECG curve over a 409 bit binary field"},
2883 {NID_sect571k1, &_EC_NIST_CHAR2_571K.h, 0,
2884 "NIST/SECG curve over a 571 bit binary field"},
2885 {NID_sect571r1, &_EC_NIST_CHAR2_571B.h, 0,
2886 "NIST/SECG curve over a 571 bit binary field"},
2887# endif
2888};
2889
2890#else
2891
2892static const ec_list_element curve_list[] = {
2893 /* prime field curves */
2894 /* secg curves */
2895 {NID_secp112r1, &_EC_SECG_PRIME_112R1.h, 0,
2896 "SECG/WTLS curve over a 112 bit prime field"},
2897 {NID_secp112r2, &_EC_SECG_PRIME_112R2.h, 0,
2898 "SECG curve over a 112 bit prime field"},
2899 {NID_secp128r1, &_EC_SECG_PRIME_128R1.h, 0,
2900 "SECG curve over a 128 bit prime field"},
2901 {NID_secp128r2, &_EC_SECG_PRIME_128R2.h, 0,
2902 "SECG curve over a 128 bit prime field"},
2903 {NID_secp160k1, &_EC_SECG_PRIME_160K1.h, 0,
2904 "SECG curve over a 160 bit prime field"},
2905 {NID_secp160r1, &_EC_SECG_PRIME_160R1.h, 0,
2906 "SECG curve over a 160 bit prime field"},
2907 {NID_secp160r2, &_EC_SECG_PRIME_160R2.h, 0,
2908 "SECG/WTLS curve over a 160 bit prime field"},
2909 /* SECG secp192r1 is the same as X9.62 prime192v1 and hence omitted */
2910 {NID_secp192k1, &_EC_SECG_PRIME_192K1.h, 0,
2911 "SECG curve over a 192 bit prime field"},
2912 {NID_secp224k1, &_EC_SECG_PRIME_224K1.h, 0,
2913 "SECG curve over a 224 bit prime field"},
2914# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
2915 {NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method,
2916 "NIST/SECG curve over a 224 bit prime field"},
2917# else
2918 {NID_secp224r1, &_EC_NIST_PRIME_224.h, 0,
2919 "NIST/SECG curve over a 224 bit prime field"},
2920# endif
2921 {NID_secp256k1, &_EC_SECG_PRIME_256K1.h, 0,
2922 "SECG curve over a 256 bit prime field"},
2923 /* SECG secp256r1 is the same as X9.62 prime256v1 and hence omitted */
2924 {NID_secp384r1, &_EC_NIST_PRIME_384.h,
2925# if defined(S390X_EC_ASM)
2926 EC_GFp_s390x_nistp384_method,
2927# else
2928 0,
2929# endif
2930 "NIST/SECG curve over a 384 bit prime field"},
2931 {NID_secp521r1, &_EC_NIST_PRIME_521.h,
2932# if defined(S390X_EC_ASM)
2933 EC_GFp_s390x_nistp521_method,
2934# elif !defined(OPENSSL_NO_EC_NISTP_64_GCC_128)
2935 EC_GFp_nistp521_method,
2936# else
2937 0,
2938# endif
2939 "NIST/SECG curve over a 521 bit prime field"},
2940 /* X9.62 curves */
2941 {NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0,
2942 "NIST/X9.62/SECG curve over a 192 bit prime field"},
2943 {NID_X9_62_prime192v2, &_EC_X9_62_PRIME_192V2.h, 0,
2944 "X9.62 curve over a 192 bit prime field"},
2945 {NID_X9_62_prime192v3, &_EC_X9_62_PRIME_192V3.h, 0,
2946 "X9.62 curve over a 192 bit prime field"},
2947 {NID_X9_62_prime239v1, &_EC_X9_62_PRIME_239V1.h, 0,
2948 "X9.62 curve over a 239 bit prime field"},
2949 {NID_X9_62_prime239v2, &_EC_X9_62_PRIME_239V2.h, 0,
2950 "X9.62 curve over a 239 bit prime field"},
2951 {NID_X9_62_prime239v3, &_EC_X9_62_PRIME_239V3.h, 0,
2952 "X9.62 curve over a 239 bit prime field"},
2953 {NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h,
2954# if defined(ECP_NISTZ256_ASM)
2955 EC_GFp_nistz256_method,
2956# elif defined(S390X_EC_ASM)
2957 EC_GFp_s390x_nistp256_method,
2958# elif !defined(OPENSSL_NO_EC_NISTP_64_GCC_128)
2959 EC_GFp_nistp256_method,
2960# else
2961 0,
2962# endif
2963 "X9.62/SECG curve over a 256 bit prime field"},
2964# ifndef OPENSSL_NO_EC2M
2965 /* characteristic two field curves */
2966 /* NIST/SECG curves */
2967 {NID_sect113r1, &_EC_SECG_CHAR2_113R1.h, 0,
2968 "SECG curve over a 113 bit binary field"},
2969 {NID_sect113r2, &_EC_SECG_CHAR2_113R2.h, 0,
2970 "SECG curve over a 113 bit binary field"},
2971 {NID_sect131r1, &_EC_SECG_CHAR2_131R1.h, 0,
2972 "SECG/WTLS curve over a 131 bit binary field"},
2973 {NID_sect131r2, &_EC_SECG_CHAR2_131R2.h, 0,
2974 "SECG curve over a 131 bit binary field"},
2975 {NID_sect163k1, &_EC_NIST_CHAR2_163K.h, 0,
2976 "NIST/SECG/WTLS curve over a 163 bit binary field"},
2977 {NID_sect163r1, &_EC_SECG_CHAR2_163R1.h, 0,
2978 "SECG curve over a 163 bit binary field"},
2979 {NID_sect163r2, &_EC_NIST_CHAR2_163B.h, 0,
2980 "NIST/SECG curve over a 163 bit binary field"},
2981 {NID_sect193r1, &_EC_SECG_CHAR2_193R1.h, 0,
2982 "SECG curve over a 193 bit binary field"},
2983 {NID_sect193r2, &_EC_SECG_CHAR2_193R2.h, 0,
2984 "SECG curve over a 193 bit binary field"},
2985 {NID_sect233k1, &_EC_NIST_CHAR2_233K.h, 0,
2986 "NIST/SECG/WTLS curve over a 233 bit binary field"},
2987 {NID_sect233r1, &_EC_NIST_CHAR2_233B.h, 0,
2988 "NIST/SECG/WTLS curve over a 233 bit binary field"},
2989 {NID_sect239k1, &_EC_SECG_CHAR2_239K1.h, 0,
2990 "SECG curve over a 239 bit binary field"},
2991 {NID_sect283k1, &_EC_NIST_CHAR2_283K.h, 0,
2992 "NIST/SECG curve over a 283 bit binary field"},
2993 {NID_sect283r1, &_EC_NIST_CHAR2_283B.h, 0,
2994 "NIST/SECG curve over a 283 bit binary field"},
2995 {NID_sect409k1, &_EC_NIST_CHAR2_409K.h, 0,
2996 "NIST/SECG curve over a 409 bit binary field"},
2997 {NID_sect409r1, &_EC_NIST_CHAR2_409B.h, 0,
2998 "NIST/SECG curve over a 409 bit binary field"},
2999 {NID_sect571k1, &_EC_NIST_CHAR2_571K.h, 0,
3000 "NIST/SECG curve over a 571 bit binary field"},
3001 {NID_sect571r1, &_EC_NIST_CHAR2_571B.h, 0,
3002 "NIST/SECG curve over a 571 bit binary field"},
3003 /* X9.62 curves */
3004 {NID_X9_62_c2pnb163v1, &_EC_X9_62_CHAR2_163V1.h, 0,
3005 "X9.62 curve over a 163 bit binary field"},
3006 {NID_X9_62_c2pnb163v2, &_EC_X9_62_CHAR2_163V2.h, 0,
3007 "X9.62 curve over a 163 bit binary field"},
3008 {NID_X9_62_c2pnb163v3, &_EC_X9_62_CHAR2_163V3.h, 0,
3009 "X9.62 curve over a 163 bit binary field"},
3010 {NID_X9_62_c2pnb176v1, &_EC_X9_62_CHAR2_176V1.h, 0,
3011 "X9.62 curve over a 176 bit binary field"},
3012 {NID_X9_62_c2tnb191v1, &_EC_X9_62_CHAR2_191V1.h, 0,
3013 "X9.62 curve over a 191 bit binary field"},
3014 {NID_X9_62_c2tnb191v2, &_EC_X9_62_CHAR2_191V2.h, 0,
3015 "X9.62 curve over a 191 bit binary field"},
3016 {NID_X9_62_c2tnb191v3, &_EC_X9_62_CHAR2_191V3.h, 0,
3017 "X9.62 curve over a 191 bit binary field"},
3018 {NID_X9_62_c2pnb208w1, &_EC_X9_62_CHAR2_208W1.h, 0,
3019 "X9.62 curve over a 208 bit binary field"},
3020 {NID_X9_62_c2tnb239v1, &_EC_X9_62_CHAR2_239V1.h, 0,
3021 "X9.62 curve over a 239 bit binary field"},
3022 {NID_X9_62_c2tnb239v2, &_EC_X9_62_CHAR2_239V2.h, 0,
3023 "X9.62 curve over a 239 bit binary field"},
3024 {NID_X9_62_c2tnb239v3, &_EC_X9_62_CHAR2_239V3.h, 0,
3025 "X9.62 curve over a 239 bit binary field"},
3026 {NID_X9_62_c2pnb272w1, &_EC_X9_62_CHAR2_272W1.h, 0,
3027 "X9.62 curve over a 272 bit binary field"},
3028 {NID_X9_62_c2pnb304w1, &_EC_X9_62_CHAR2_304W1.h, 0,
3029 "X9.62 curve over a 304 bit binary field"},
3030 {NID_X9_62_c2tnb359v1, &_EC_X9_62_CHAR2_359V1.h, 0,
3031 "X9.62 curve over a 359 bit binary field"},
3032 {NID_X9_62_c2pnb368w1, &_EC_X9_62_CHAR2_368W1.h, 0,
3033 "X9.62 curve over a 368 bit binary field"},
3034 {NID_X9_62_c2tnb431r1, &_EC_X9_62_CHAR2_431R1.h, 0,
3035 "X9.62 curve over a 431 bit binary field"},
3036 /*
3037 * the WAP/WTLS curves [unlike SECG, spec has its own OIDs for curves
3038 * from X9.62]
3039 */
3040 {NID_wap_wsg_idm_ecid_wtls1, &_EC_WTLS_1.h, 0,
3041 "WTLS curve over a 113 bit binary field"},
3042 {NID_wap_wsg_idm_ecid_wtls3, &_EC_NIST_CHAR2_163K.h, 0,
3043 "NIST/SECG/WTLS curve over a 163 bit binary field"},
3044 {NID_wap_wsg_idm_ecid_wtls4, &_EC_SECG_CHAR2_113R1.h, 0,
3045 "SECG curve over a 113 bit binary field"},
3046 {NID_wap_wsg_idm_ecid_wtls5, &_EC_X9_62_CHAR2_163V1.h, 0,
3047 "X9.62 curve over a 163 bit binary field"},
3048# endif
3049 {NID_wap_wsg_idm_ecid_wtls6, &_EC_SECG_PRIME_112R1.h, 0,
3050 "SECG/WTLS curve over a 112 bit prime field"},
3051 {NID_wap_wsg_idm_ecid_wtls7, &_EC_SECG_PRIME_160R2.h, 0,
3052 "SECG/WTLS curve over a 160 bit prime field"},
3053 {NID_wap_wsg_idm_ecid_wtls8, &_EC_WTLS_8.h, 0,
3054 "WTLS curve over a 112 bit prime field"},
3055 {NID_wap_wsg_idm_ecid_wtls9, &_EC_WTLS_9.h, 0,
3056 "WTLS curve over a 160 bit prime field"},
3057# ifndef OPENSSL_NO_EC2M
3058 {NID_wap_wsg_idm_ecid_wtls10, &_EC_NIST_CHAR2_233K.h, 0,
3059 "NIST/SECG/WTLS curve over a 233 bit binary field"},
3060 {NID_wap_wsg_idm_ecid_wtls11, &_EC_NIST_CHAR2_233B.h, 0,
3061 "NIST/SECG/WTLS curve over a 233 bit binary field"},
3062# endif
3063 {NID_wap_wsg_idm_ecid_wtls12, &_EC_WTLS_12.h, 0,
3064 "WTLS curve over a 224 bit prime field"},
3065# ifndef OPENSSL_NO_EC2M
3066 /* IPSec curves */
3067 {NID_ipsec3, &_EC_IPSEC_155_ID3.h, 0,
3068 "\n\tIPSec/IKE/Oakley curve #3 over a 155 bit binary field.\n"
3069 "\tNot suitable for ECDSA.\n\tQuestionable extension field!"},
3070 {NID_ipsec4, &_EC_IPSEC_185_ID4.h, 0,
3071 "\n\tIPSec/IKE/Oakley curve #4 over a 185 bit binary field.\n"
3072 "\tNot suitable for ECDSA.\n\tQuestionable extension field!"},
3073# endif
3074 /* brainpool curves */
3075 {NID_brainpoolP160r1, &_EC_brainpoolP160r1.h, 0,
3076 "RFC 5639 curve over a 160 bit prime field"},
3077 {NID_brainpoolP160t1, &_EC_brainpoolP160t1.h, 0,
3078 "RFC 5639 curve over a 160 bit prime field"},
3079 {NID_brainpoolP192r1, &_EC_brainpoolP192r1.h, 0,
3080 "RFC 5639 curve over a 192 bit prime field"},
3081 {NID_brainpoolP192t1, &_EC_brainpoolP192t1.h, 0,
3082 "RFC 5639 curve over a 192 bit prime field"},
3083 {NID_brainpoolP224r1, &_EC_brainpoolP224r1.h, 0,
3084 "RFC 5639 curve over a 224 bit prime field"},
3085 {NID_brainpoolP224t1, &_EC_brainpoolP224t1.h, 0,
3086 "RFC 5639 curve over a 224 bit prime field"},
3087 {NID_brainpoolP256r1, &_EC_brainpoolP256r1.h, 0,
3088 "RFC 5639 curve over a 256 bit prime field"},
3089 {NID_brainpoolP256t1, &_EC_brainpoolP256t1.h, 0,
3090 "RFC 5639 curve over a 256 bit prime field"},
3091 {NID_brainpoolP320r1, &_EC_brainpoolP320r1.h, 0,
3092 "RFC 5639 curve over a 320 bit prime field"},
3093 {NID_brainpoolP320t1, &_EC_brainpoolP320t1.h, 0,
3094 "RFC 5639 curve over a 320 bit prime field"},
3095 {NID_brainpoolP384r1, &_EC_brainpoolP384r1.h, 0,
3096 "RFC 5639 curve over a 384 bit prime field"},
3097 {NID_brainpoolP384t1, &_EC_brainpoolP384t1.h, 0,
3098 "RFC 5639 curve over a 384 bit prime field"},
3099 {NID_brainpoolP512r1, &_EC_brainpoolP512r1.h, 0,
3100 "RFC 5639 curve over a 512 bit prime field"},
3101 {NID_brainpoolP512t1, &_EC_brainpoolP512t1.h, 0,
3102 "RFC 5639 curve over a 512 bit prime field"},
3103# ifndef OPENSSL_NO_SM2
3104 {NID_sm2, &_EC_sm2p256v1.h, 0,
3105 "SM2 curve over a 256 bit prime field"},
3106# endif
3107};
3108#endif /* FIPS_MODE */
3109
3110#define curve_list_length OSSL_NELEM(curve_list)
3111
3112static EC_GROUP *ec_group_new_from_data(OPENSSL_CTX *libctx,
3113 const ec_list_element curve)
3114{
3115 EC_GROUP *group = NULL;
3116 EC_POINT *P = NULL;
3117 BN_CTX *ctx = NULL;
3118 BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *order =
3119 NULL;
3120 int ok = 0;
3121 int seed_len, param_len;
3122 const EC_METHOD *meth;
3123 const EC_CURVE_DATA *data;
3124 const unsigned char *params;
3125
3126 /* If no curve data curve method must handle everything */
3127 if (curve.data == NULL)
3128 return EC_GROUP_new_ex(libctx,
3129 curve.meth != NULL ? curve.meth() : NULL);
3130
3131 if ((ctx = BN_CTX_new_ex(libctx)) == NULL) {
3132 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_MALLOC_FAILURE);
3133 goto err;
3134 }
3135
3136 data = curve.data;
3137 seed_len = data->seed_len;
3138 param_len = data->param_len;
3139 params = (const unsigned char *)(data + 1); /* skip header */
3140 params += seed_len; /* skip seed */
3141
3142 if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
3143 || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
3144 || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
3145 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_BN_LIB);
3146 goto err;
3147 }
3148
3149 if (curve.meth != 0) {
3150 meth = curve.meth();
3151 if (((group = EC_GROUP_new_ex(libctx, meth)) == NULL) ||
3152 (!(group->meth->group_set_curve(group, p, a, b, ctx)))) {
3153 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
3154 goto err;
3155 }
3156 } else if (data->field_type == NID_X9_62_prime_field) {
3157 if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) {
3158 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
3159 goto err;
3160 }
3161 }
3162#ifndef OPENSSL_NO_EC2M
3163 else { /* field_type ==
3164 * NID_X9_62_characteristic_two_field */
3165
3166 if ((group = EC_GROUP_new_curve_GF2m(p, a, b, ctx)) == NULL) {
3167 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
3168 goto err;
3169 }
3170 }
3171#endif
3172
3173 EC_GROUP_set_curve_name(group, curve.nid);
3174
3175 if ((P = EC_POINT_new(group)) == NULL) {
3176 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
3177 goto err;
3178 }
3179
3180 if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
3181 || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
3182 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_BN_LIB);
3183 goto err;
3184 }
3185 if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
3186 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
3187 goto err;
3188 }
3189 if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
3190 || !BN_set_word(x, (BN_ULONG)data->cofactor)) {
3191 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_BN_LIB);
3192 goto err;
3193 }
3194 if (!EC_GROUP_set_generator(group, P, order, x)) {
3195 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
3196 goto err;
3197 }
3198 if (seed_len) {
3199 if (!EC_GROUP_set_seed(group, params - seed_len, seed_len)) {
3200 ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
3201 goto err;
3202 }
3203 }
3204 ok = 1;
3205 err:
3206 if (!ok) {
3207 EC_GROUP_free(group);
3208 group = NULL;
3209 }
3210 EC_POINT_free(P);
3211 BN_CTX_free(ctx);
3212 BN_free(p);
3213 BN_free(a);
3214 BN_free(b);
3215 BN_free(order);
3216 BN_free(x);
3217 BN_free(y);
3218 return group;
3219}
3220
3221EC_GROUP *EC_GROUP_new_by_curve_name_ex(OPENSSL_CTX *libctx, int nid)
3222{
3223 size_t i;
3224 EC_GROUP *ret = NULL;
3225
3226 if (nid <= 0)
3227 return NULL;
3228
3229#ifdef FIPS_MODE
3230 /*
3231 * Only use approved NIST curves in FIPS.
3232 * NOTE: "B-163", "K-163" & "P-192" can only be used for legacy use
3233 * (i.e- ECDSA signature verification).
3234 */
3235 if (EC_curve_nid2nist(nid) == NULL)
3236 return NULL;
3237#endif /* FIPS_MODE */
3238 for (i = 0; i < curve_list_length; i++)
3239 if (curve_list[i].nid == nid) {
3240 ret = ec_group_new_from_data(libctx, curve_list[i]);
3241 break;
3242 }
3243
3244 if (ret == NULL) {
3245 ECerr(EC_F_EC_GROUP_NEW_BY_CURVE_NAME_EX, EC_R_UNKNOWN_GROUP);
3246 return NULL;
3247 }
3248
3249 return ret;
3250}
3251
3252#ifndef FIPS_MODE
3253EC_GROUP *EC_GROUP_new_by_curve_name(int nid)
3254{
3255 return EC_GROUP_new_by_curve_name_ex(NULL, nid);
3256}
3257#endif
3258
3259size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems)
3260{
3261 size_t i, min;
3262
3263 if (r == NULL || nitems == 0)
3264 return curve_list_length;
3265
3266 min = nitems < curve_list_length ? nitems : curve_list_length;
3267
3268 for (i = 0; i < min; i++) {
3269 r[i].nid = curve_list[i].nid;
3270 r[i].comment = curve_list[i].comment;
3271 }
3272
3273 return curve_list_length;
3274}
3275
3276/* Functions to translate between common NIST curve names and NIDs */
3277
3278typedef struct {
3279 const char *name; /* NIST Name of curve */
3280 int nid; /* Curve NID */
3281} EC_NIST_NAME;
3282
3283static EC_NIST_NAME nist_curves[] = {
3284 {"B-163", NID_sect163r2},
3285 {"B-233", NID_sect233r1},
3286 {"B-283", NID_sect283r1},
3287 {"B-409", NID_sect409r1},
3288 {"B-571", NID_sect571r1},
3289 {"K-163", NID_sect163k1},
3290 {"K-233", NID_sect233k1},
3291 {"K-283", NID_sect283k1},
3292 {"K-409", NID_sect409k1},
3293 {"K-571", NID_sect571k1},
3294 {"P-192", NID_X9_62_prime192v1},
3295 {"P-224", NID_secp224r1},
3296 {"P-256", NID_X9_62_prime256v1},
3297 {"P-384", NID_secp384r1},
3298 {"P-521", NID_secp521r1}
3299};
3300
3301const char *EC_curve_nid2nist(int nid)
3302{
3303 size_t i;
3304 for (i = 0; i < OSSL_NELEM(nist_curves); i++) {
3305 if (nist_curves[i].nid == nid)
3306 return nist_curves[i].name;
3307 }
3308 return NULL;
3309}
3310
3311int EC_curve_nist2nid(const char *name)
3312{
3313 size_t i;
3314 for (i = 0; i < OSSL_NELEM(nist_curves); i++) {
3315 if (strcmp(nist_curves[i].name, name) == 0)
3316 return nist_curves[i].nid;
3317 }
3318 return NID_undef;
3319}
3320
3321#define NUM_BN_FIELDS 6
3322/*
3323 * Validates EC domain parameter data for known named curves.
3324 * This can be used when a curve is loaded explicitly (without a curve
3325 * name) or to validate that domain parameters have not been modified.
3326 *
3327 * Returns: The nid associated with the found named curve, or NID_undef
3328 * if not found. If there was an error it returns -1.
3329 */
3330int ec_curve_nid_from_params(const EC_GROUP *group, BN_CTX *ctx)
3331{
3332 int ret = -1, nid, len, field_type, param_len;
3333 size_t i, seed_len;
3334 const unsigned char *seed, *params_seed, *params;
3335 unsigned char *param_bytes = NULL;
3336 const EC_CURVE_DATA *data;
3337 const EC_POINT *generator = NULL;
3338 const EC_METHOD *meth;
3339 const BIGNUM *cofactor = NULL;
3340 /* An array of BIGNUMs for (p, a, b, x, y, order) */
3341 BIGNUM *bn[NUM_BN_FIELDS] = {NULL, NULL, NULL, NULL, NULL, NULL};
3342
3343 meth = EC_GROUP_method_of(group);
3344 if (meth == NULL)
3345 return -1;
3346 /* Use the optional named curve nid as a search field */
3347 nid = EC_GROUP_get_curve_name(group);
3348 field_type = EC_METHOD_get_field_type(meth);
3349 seed_len = EC_GROUP_get_seed_len(group);
3350 seed = EC_GROUP_get0_seed(group);
3351 cofactor = EC_GROUP_get0_cofactor(group);
3352
3353 BN_CTX_start(ctx);
3354
3355 /*
3356 * The built-in curves contains data fields (p, a, b, x, y, order) that are
3357 * all zero-padded to be the same size. The size of the padding is
3358 * determined by either the number of bytes in the field modulus (p) or the
3359 * EC group order, whichever is larger.
3360 */
3361 param_len = BN_num_bytes(group->order);
3362 len = BN_num_bytes(group->field);
3363 if (len > param_len)
3364 param_len = len;
3365
3366 /* Allocate space to store the padded data for (p, a, b, x, y, order) */
3367 param_bytes = OPENSSL_malloc(param_len * NUM_BN_FIELDS);
3368 if (param_bytes == NULL)
3369 goto end;
3370
3371 /* Create the bignums */
3372 for (i = 0; i < NUM_BN_FIELDS; ++i) {
3373 if ((bn[i] = BN_CTX_get(ctx)) == NULL)
3374 goto end;
3375 }
3376 /*
3377 * Fill in the bn array with the same values as the internal curves
3378 * i.e. the values are p, a, b, x, y, order.
3379 */
3380 /* Get p, a & b */
3381 if (!(EC_GROUP_get_curve(group, bn[0], bn[1], bn[2], ctx)
3382 && ((generator = EC_GROUP_get0_generator(group)) != NULL)
3383 /* Get x & y */
3384 && EC_POINT_get_affine_coordinates(group, generator, bn[3], bn[4], ctx)
3385 /* Get order */
3386 && EC_GROUP_get_order(group, bn[5], ctx)))
3387 goto end;
3388
3389 /*
3390 * Convert the bignum array to bytes that are joined together to form
3391 * a single buffer that contains data for all fields.
3392 * (p, a, b, x, y, order) are all zero padded to be the same size.
3393 */
3394 for (i = 0; i < NUM_BN_FIELDS; ++i) {
3395 if (BN_bn2binpad(bn[i], &param_bytes[i*param_len], param_len) <= 0)
3396 goto end;
3397 }
3398
3399 for (i = 0; i < curve_list_length; i++) {
3400 const ec_list_element curve = curve_list[i];
3401
3402 data = curve.data;
3403 /* Get the raw order byte data */
3404 params_seed = (const unsigned char *)(data + 1); /* skip header */
3405 params = params_seed + data->seed_len;
3406
3407 /* Look for unique fields in the fixed curve data */
3408 if (data->field_type == field_type
3409 && param_len == data->param_len
3410 && (nid <= 0 || nid == curve.nid)
3411 /* check the optional cofactor (ignore if its zero) */
3412 && (BN_is_zero(cofactor)
3413 || BN_is_word(cofactor, (const BN_ULONG)curve.data->cofactor))
3414 /* Check the optional seed (ignore if its not set) */
3415 && (data->seed_len == 0 || seed_len == 0
3416 || ((size_t)data->seed_len == seed_len
3417 && memcmp(params_seed, seed, seed_len) == 0))
3418 /* Check that the groups params match the built-in curve params */
3419 && memcmp(param_bytes, params, param_len * NUM_BN_FIELDS)
3420 == 0) {
3421 ret = curve.nid;
3422 goto end;
3423 }
3424 }
3425 /* Gets here if the group was not found */
3426 ret = NID_undef;
3427end:
3428 OPENSSL_free(param_bytes);
3429 BN_CTX_end(ctx);
3430 return ret;
3431}
3432