• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Microsoft Reference Implementation for TPM 2.0
2  *
3  *  The copyright in this software is being made available under the BSD License,
4  *  included below. This software may be subject to other third party and
5  *  contributor rights, including patent rights, and no such rights are granted
6  *  under this license.
7  *
8  *  Copyright (c) Microsoft Corporation
9  *
10  *  All rights reserved.
11  *
12  *  BSD License
13  *
14  *  Redistribution and use in source and binary forms, with or without modification,
15  *  are permitted provided that the following conditions are met:
16  *
17  *  Redistributions of source code must retain the above copyright notice, this list
18  *  of conditions and the following disclaimer.
19  *
20  *  Redistributions in binary form must reproduce the above copyright notice, this
21  *  list of conditions and the following disclaimer in the documentation and/or
22  *  other materials provided with the distribution.
23  *
24  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS""
25  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  *  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
28  *  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31  *  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 /*(Auto-generated)
36  *  Created by TpmStructures; Version 4.4 Mar 26, 2019
37  *  Date: Aug 30, 2019  Time: 02:11:52PM
38  */
39 
40 #include "Tpm.h"
41 #include "OIDs.h"
42 
43 
44 // This file contains the ECC curve data. The format of the data depends on the
45 // setting of USE_BN_ECC_DATA. If it is defined, then the TPM's BigNum format is
46 // used. Otherwise, it is kept in TPM2B format. The purpose of having the data in
47 // BigNum format is so that it does not have to be reformatted before being used
48 // by the crypto library.
49 
50 #if ALG_ECC
51 
52 #if USE_BN_ECC_DATA
53 #       define TO_ECC_64                        TO_CRYPT_WORD_64
54 #       define TO_ECC_56(a, b, c, d, e, f, g)   TO_ECC_64(0, a, b, c, d, e, f, g)
55 #       define TO_ECC_48(a, b, c, d, e, f)      TO_ECC_64(0, 0, a, b, c, d, e, f)
56 #       define TO_ECC_40(a, b, c, d, e)         TO_ECC_64(0, 0, 0, a, b, c, d, e)
57 #   if RADIX_BITS > 32
58 #       define TO_ECC_32(a, b, c, d)            TO_ECC_64(0, 0, 0, 0, a, b, c, d)
59 #       define TO_ECC_24(a, b, c)               TO_ECC_64(0, 0, 0, 0, 0, a, b, c)
60 #       define TO_ECC_16(a, b)                  TO_ECC_64(0, 0, 0, 0, 0, 0, a, b)
61 #       define TO_ECC_8(a)                      TO_ECC_64(0, 0, 0, 0, 0, 0, 0, a)
62 #   else // RADIX_BITS == 32
63 #       define TO_ECC_32                        BIG_ENDIAN_BYTES_TO_UINT32
64 #       define TO_ECC_24(a, b, c)               TO_ECC_32(0, a, b, c)
65 #       define TO_ECC_16(a, b)                  TO_ECC_32(0, 0, a, b)
66 #       define TO_ECC_8(a)                      TO_ECC_32(0, 0, 0, a)
67 #   endif
68 #else // TPM2B_
69 #   define TO_ECC_64(a, b, c, d, e, f, g, h) a, b, c, d, e, f, g, h
70 #   define TO_ECC_56(a, b, c, d, e, f, g)    a, b, c, d, e, f, g
71 #   define TO_ECC_48(a, b, c, d, e, f)       a, b, c, d, e, f
72 #   define TO_ECC_40(a, b, c, d, e)          a, b, c, d, e
73 #   define TO_ECC_32(a, b, c, d)             a, b, c, d
74 #   define TO_ECC_24(a, b, c)                a, b, c
75 #   define TO_ECC_16(a, b)                   a, b
76 #   define TO_ECC_8(a)                       a
77 #endif
78 
79 #if USE_BN_ECC_DATA
80 #define BN_MIN_ALLOC(bytes)                                                        \
81             (BYTES_TO_CRYPT_WORDS(bytes) == 0) ? 1 : BYTES_TO_CRYPT_WORDS(bytes)
82 # define ECC_CONST(NAME, bytes, initializer)                                       \
83     const struct {                                                                 \
84         crypt_uword_t   allocate, size, d[BN_MIN_ALLOC(bytes)];                    \
85         } NAME = {BN_MIN_ALLOC(bytes), BYTES_TO_CRYPT_WORDS(bytes),{initializer}}
86 
87 ECC_CONST(ECC_ZERO, 0, 0);
88 
89 #else
90 # define ECC_CONST(NAME, bytes, initializer)                                       \
91        const TPM2B_##bytes##_BYTE_VALUE NAME = {bytes, {initializer}}
92 
93 // Have to special case ECC_ZERO
94 TPM2B_BYTE_VALUE(1);
95 TPM2B_1_BYTE_VALUE ECC_ZERO = {1, {0}};
96 
97 
98 #endif
99 
100 ECC_CONST(ECC_ONE, 1, 1);
101 
102 #if !USE_BN_ECC_DATA
103 TPM2B_BYTE_VALUE(24);
104 #define TO_ECC_192(a, b, c)  a, b, c
105 TPM2B_BYTE_VALUE(28);
106 #define TO_ECC_224(a, b, c, d)   a, b, c, d
107 TPM2B_BYTE_VALUE(32);
108 #define TO_ECC_256(a, b, c, d)   a, b, c, d
109 TPM2B_BYTE_VALUE(48);
110 #define TO_ECC_384(a, b, c, d, e, f)     a, b, c, d, e, f
111 TPM2B_BYTE_VALUE(66);
112 #define TO_ECC_528(a, b, c, d, e, f, g, h, i)    a, b, c, d, e, f, g, h, i
113 TPM2B_BYTE_VALUE(80);
114 #define TO_ECC_640(a, b, c, d, e, f, g, h, i, j)     a, b, c, d, e, f, g, h, i, j
115 #else
116 #define TO_ECC_192(a, b, c)  c, b, a
117 #define TO_ECC_224(a, b, c, d)   d, c, b, a
118 #define TO_ECC_256(a, b, c, d)   d, c, b, a
119 #define TO_ECC_384(a, b, c, d, e, f)     f, e, d, c, b, a
120 #define TO_ECC_528(a, b, c, d, e, f, g, h, i)    i, h, g, f, e, d, c, b, a
121 #define TO_ECC_640(a, b, c, d, e, f, g, h, i, j)     j, i, h, g, f, e, d, c, b, a
122 #endif // !USE_BN_ECC_DATA
123 
124 #if ECC_NIST_P192
125 ECC_CONST(NIST_P192_p, 24, TO_ECC_192(
126     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
127     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE),
128     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)));
129 ECC_CONST(NIST_P192_a, 24, TO_ECC_192(
130     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
131     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE),
132     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC)));
133 ECC_CONST(NIST_P192_b, 24, TO_ECC_192(
134     TO_ECC_64(0x64, 0x21, 0x05, 0x19, 0xE5, 0x9C, 0x80, 0xE7),
135     TO_ECC_64(0x0F, 0xA7, 0xE9, 0xAB, 0x72, 0x24, 0x30, 0x49),
136     TO_ECC_64(0xFE, 0xB8, 0xDE, 0xEC, 0xC1, 0x46, 0xB9, 0xB1)));
137 ECC_CONST(NIST_P192_gX, 24, TO_ECC_192(
138     TO_ECC_64(0x18, 0x8D, 0xA8, 0x0E, 0xB0, 0x30, 0x90, 0xF6),
139     TO_ECC_64(0x7C, 0xBF, 0x20, 0xEB, 0x43, 0xA1, 0x88, 0x00),
140     TO_ECC_64(0xF4, 0xFF, 0x0A, 0xFD, 0x82, 0xFF, 0x10, 0x12)));
141 ECC_CONST(NIST_P192_gY, 24, TO_ECC_192(
142     TO_ECC_64(0x07, 0x19, 0x2B, 0x95, 0xFF, 0xC8, 0xDA, 0x78),
143     TO_ECC_64(0x63, 0x10, 0x11, 0xED, 0x6B, 0x24, 0xCD, 0xD5),
144     TO_ECC_64(0x73, 0xF9, 0x77, 0xA1, 0x1E, 0x79, 0x48, 0x11)));
145 ECC_CONST(NIST_P192_n, 24, TO_ECC_192(
146     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
147     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0xDE, 0xF8, 0x36),
148     TO_ECC_64(0x14, 0x6B, 0xC9, 0xB1, 0xB4, 0xD2, 0x28, 0x31)));
149 #define NIST_P192_h         ECC_ONE
150 #define NIST_P192_gZ        ECC_ONE
151 
152 #if USE_BN_ECC_DATA
153     const ECC_CURVE_DATA NIST_P192 = {
154         (bigNum)&NIST_P192_p, (bigNum)&NIST_P192_n, (bigNum)&NIST_P192_h,
155         (bigNum)&NIST_P192_a, (bigNum)&NIST_P192_b,
156         {(bigNum)&NIST_P192_gX, (bigNum)&NIST_P192_gY, (bigNum)&NIST_P192_gZ}};
157 
158 #else
159     const ECC_CURVE_DATA NIST_P192 = {
160         &NIST_P192_p.b, &NIST_P192_n.b, &NIST_P192_h.b,
161         &NIST_P192_a.b, &NIST_P192_b.b,
162         {&NIST_P192_gX.b, &NIST_P192_gY.b, &NIST_P192_gZ.b}};
163 
164 #endif // USE_BN_ECC_DATA
165 
166 #endif // ECC_NIST_P192
167 
168 
169 #if ECC_NIST_P224
170 ECC_CONST(NIST_P224_p, 28, TO_ECC_224(
171     TO_ECC_32(0xFF, 0xFF, 0xFF, 0xFF),
172     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
173     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00),
174     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01)));
175 ECC_CONST(NIST_P224_a, 28, TO_ECC_224(
176     TO_ECC_32(0xFF, 0xFF, 0xFF, 0xFF),
177     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
178     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF),
179     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE)));
180 ECC_CONST(NIST_P224_b, 28, TO_ECC_224(
181     TO_ECC_32(0xB4, 0x05, 0x0A, 0x85),
182     TO_ECC_64(0x0C, 0x04, 0xB3, 0xAB, 0xF5, 0x41, 0x32, 0x56),
183     TO_ECC_64(0x50, 0x44, 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA),
184     TO_ECC_64(0x27, 0x0B, 0x39, 0x43, 0x23, 0x55, 0xFF, 0xB4)));
185 ECC_CONST(NIST_P224_gX, 28, TO_ECC_224(
186     TO_ECC_32(0xB7, 0x0E, 0x0C, 0xBD),
187     TO_ECC_64(0x6B, 0xB4, 0xBF, 0x7F, 0x32, 0x13, 0x90, 0xB9),
188     TO_ECC_64(0x4A, 0x03, 0xC1, 0xD3, 0x56, 0xC2, 0x11, 0x22),
189     TO_ECC_64(0x34, 0x32, 0x80, 0xD6, 0x11, 0x5C, 0x1D, 0x21)));
190 ECC_CONST(NIST_P224_gY, 28, TO_ECC_224(
191     TO_ECC_32(0xBD, 0x37, 0x63, 0x88),
192     TO_ECC_64(0xB5, 0xF7, 0x23, 0xFB, 0x4C, 0x22, 0xDF, 0xE6),
193     TO_ECC_64(0xCD, 0x43, 0x75, 0xA0, 0x5A, 0x07, 0x47, 0x64),
194     TO_ECC_64(0x44, 0xD5, 0x81, 0x99, 0x85, 0x00, 0x7E, 0x34)));
195 ECC_CONST(NIST_P224_n, 28, TO_ECC_224(
196     TO_ECC_32(0xFF, 0xFF, 0xFF, 0xFF),
197     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
198     TO_ECC_64(0xFF, 0xFF, 0x16, 0xA2, 0xE0, 0xB8, 0xF0, 0x3E),
199     TO_ECC_64(0x13, 0xDD, 0x29, 0x45, 0x5C, 0x5C, 0x2A, 0x3D)));
200 #define NIST_P224_h         ECC_ONE
201 #define NIST_P224_gZ        ECC_ONE
202 
203 #if USE_BN_ECC_DATA
204     const ECC_CURVE_DATA NIST_P224 = {
205         (bigNum)&NIST_P224_p, (bigNum)&NIST_P224_n, (bigNum)&NIST_P224_h,
206         (bigNum)&NIST_P224_a, (bigNum)&NIST_P224_b,
207         {(bigNum)&NIST_P224_gX, (bigNum)&NIST_P224_gY, (bigNum)&NIST_P224_gZ}};
208 
209 #else
210     const ECC_CURVE_DATA NIST_P224 = {
211         &NIST_P224_p.b, &NIST_P224_n.b, &NIST_P224_h.b,
212         &NIST_P224_a.b, &NIST_P224_b.b,
213         {&NIST_P224_gX.b, &NIST_P224_gY.b, &NIST_P224_gZ.b}};
214 
215 #endif // USE_BN_ECC_DATA
216 
217 #endif // ECC_NIST_P224
218 
219 
220 #if ECC_NIST_P256
221 ECC_CONST(NIST_P256_p, 32, TO_ECC_256(
222     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01),
223     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
224     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF),
225     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)));
226 ECC_CONST(NIST_P256_a, 32, TO_ECC_256(
227     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01),
228     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
229     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF),
230     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC)));
231 ECC_CONST(NIST_P256_b, 32, TO_ECC_256(
232     TO_ECC_64(0x5A, 0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, 0xE7),
233     TO_ECC_64(0xB3, 0xEB, 0xBD, 0x55, 0x76, 0x98, 0x86, 0xBC),
234     TO_ECC_64(0x65, 0x1D, 0x06, 0xB0, 0xCC, 0x53, 0xB0, 0xF6),
235     TO_ECC_64(0x3B, 0xCE, 0x3C, 0x3E, 0x27, 0xD2, 0x60, 0x4B)));
236 ECC_CONST(NIST_P256_gX, 32, TO_ECC_256(
237     TO_ECC_64(0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47),
238     TO_ECC_64(0xF8, 0xBC, 0xE6, 0xE5, 0x63, 0xA4, 0x40, 0xF2),
239     TO_ECC_64(0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0),
240     TO_ECC_64(0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96)));
241 ECC_CONST(NIST_P256_gY, 32, TO_ECC_256(
242     TO_ECC_64(0x4F, 0xE3, 0x42, 0xE2, 0xFE, 0x1A, 0x7F, 0x9B),
243     TO_ECC_64(0x8E, 0xE7, 0xEB, 0x4A, 0x7C, 0x0F, 0x9E, 0x16),
244     TO_ECC_64(0x2B, 0xCE, 0x33, 0x57, 0x6B, 0x31, 0x5E, 0xCE),
245     TO_ECC_64(0xCB, 0xB6, 0x40, 0x68, 0x37, 0xBF, 0x51, 0xF5)));
246 ECC_CONST(NIST_P256_n, 32, TO_ECC_256(
247     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00),
248     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
249     TO_ECC_64(0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84),
250     TO_ECC_64(0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51)));
251 #define NIST_P256_h         ECC_ONE
252 #define NIST_P256_gZ        ECC_ONE
253 
254 #if USE_BN_ECC_DATA
255     const ECC_CURVE_DATA NIST_P256 = {
256         (bigNum)&NIST_P256_p, (bigNum)&NIST_P256_n, (bigNum)&NIST_P256_h,
257         (bigNum)&NIST_P256_a, (bigNum)&NIST_P256_b,
258         {(bigNum)&NIST_P256_gX, (bigNum)&NIST_P256_gY, (bigNum)&NIST_P256_gZ}};
259 
260 #else
261     const ECC_CURVE_DATA NIST_P256 = {
262         &NIST_P256_p.b, &NIST_P256_n.b, &NIST_P256_h.b,
263         &NIST_P256_a.b, &NIST_P256_b.b,
264         {&NIST_P256_gX.b, &NIST_P256_gY.b, &NIST_P256_gZ.b}};
265 
266 #endif // USE_BN_ECC_DATA
267 
268 #endif // ECC_NIST_P256
269 
270 
271 #if ECC_NIST_P384
272 ECC_CONST(NIST_P384_p, 48, TO_ECC_384(
273     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
274     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
275     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
276     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE),
277     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00),
278     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF)));
279 ECC_CONST(NIST_P384_a, 48, TO_ECC_384(
280     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
281     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
282     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
283     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE),
284     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00),
285     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFC)));
286 ECC_CONST(NIST_P384_b, 48, TO_ECC_384(
287     TO_ECC_64(0xB3, 0x31, 0x2F, 0xA7, 0xE2, 0x3E, 0xE7, 0xE4),
288     TO_ECC_64(0x98, 0x8E, 0x05, 0x6B, 0xE3, 0xF8, 0x2D, 0x19),
289     TO_ECC_64(0x18, 0x1D, 0x9C, 0x6E, 0xFE, 0x81, 0x41, 0x12),
290     TO_ECC_64(0x03, 0x14, 0x08, 0x8F, 0x50, 0x13, 0x87, 0x5A),
291     TO_ECC_64(0xC6, 0x56, 0x39, 0x8D, 0x8A, 0x2E, 0xD1, 0x9D),
292     TO_ECC_64(0x2A, 0x85, 0xC8, 0xED, 0xD3, 0xEC, 0x2A, 0xEF)));
293 ECC_CONST(NIST_P384_gX, 48, TO_ECC_384(
294     TO_ECC_64(0xAA, 0x87, 0xCA, 0x22, 0xBE, 0x8B, 0x05, 0x37),
295     TO_ECC_64(0x8E, 0xB1, 0xC7, 0x1E, 0xF3, 0x20, 0xAD, 0x74),
296     TO_ECC_64(0x6E, 0x1D, 0x3B, 0x62, 0x8B, 0xA7, 0x9B, 0x98),
297     TO_ECC_64(0x59, 0xF7, 0x41, 0xE0, 0x82, 0x54, 0x2A, 0x38),
298     TO_ECC_64(0x55, 0x02, 0xF2, 0x5D, 0xBF, 0x55, 0x29, 0x6C),
299     TO_ECC_64(0x3A, 0x54, 0x5E, 0x38, 0x72, 0x76, 0x0A, 0xB7)));
300 ECC_CONST(NIST_P384_gY, 48, TO_ECC_384(
301     TO_ECC_64(0x36, 0x17, 0xDE, 0x4A, 0x96, 0x26, 0x2C, 0x6F),
302     TO_ECC_64(0x5D, 0x9E, 0x98, 0xBF, 0x92, 0x92, 0xDC, 0x29),
303     TO_ECC_64(0xF8, 0xF4, 0x1D, 0xBD, 0x28, 0x9A, 0x14, 0x7C),
304     TO_ECC_64(0xE9, 0xDA, 0x31, 0x13, 0xB5, 0xF0, 0xB8, 0xC0),
305     TO_ECC_64(0x0A, 0x60, 0xB1, 0xCE, 0x1D, 0x7E, 0x81, 0x9D),
306     TO_ECC_64(0x7A, 0x43, 0x1D, 0x7C, 0x90, 0xEA, 0x0E, 0x5F)));
307 ECC_CONST(NIST_P384_n, 48, TO_ECC_384(
308     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
309     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
310     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
311     TO_ECC_64(0xC7, 0x63, 0x4D, 0x81, 0xF4, 0x37, 0x2D, 0xDF),
312     TO_ECC_64(0x58, 0x1A, 0x0D, 0xB2, 0x48, 0xB0, 0xA7, 0x7A),
313     TO_ECC_64(0xEC, 0xEC, 0x19, 0x6A, 0xCC, 0xC5, 0x29, 0x73)));
314 #define NIST_P384_h         ECC_ONE
315 #define NIST_P384_gZ        ECC_ONE
316 
317 #if USE_BN_ECC_DATA
318     const ECC_CURVE_DATA NIST_P384 = {
319         (bigNum)&NIST_P384_p, (bigNum)&NIST_P384_n, (bigNum)&NIST_P384_h,
320         (bigNum)&NIST_P384_a, (bigNum)&NIST_P384_b,
321         {(bigNum)&NIST_P384_gX, (bigNum)&NIST_P384_gY, (bigNum)&NIST_P384_gZ}};
322 
323 #else
324     const ECC_CURVE_DATA NIST_P384 = {
325         &NIST_P384_p.b, &NIST_P384_n.b, &NIST_P384_h.b,
326         &NIST_P384_a.b, &NIST_P384_b.b,
327         {&NIST_P384_gX.b, &NIST_P384_gY.b, &NIST_P384_gZ.b}};
328 
329 #endif // USE_BN_ECC_DATA
330 
331 #endif // ECC_NIST_P384
332 
333 
334 #if ECC_NIST_P521
335 ECC_CONST(NIST_P521_p, 66, TO_ECC_528(
336     TO_ECC_16(0x01, 0xFF),
337     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
338     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
339     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
340     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
341     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
342     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
343     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
344     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)));
345 ECC_CONST(NIST_P521_a, 66, TO_ECC_528(
346     TO_ECC_16(0x01, 0xFF),
347     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
348     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
349     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
350     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
351     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
352     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
353     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
354     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC)));
355 ECC_CONST(NIST_P521_b, 66, TO_ECC_528(
356     TO_ECC_16(0x00, 0x51),
357     TO_ECC_64(0x95, 0x3E, 0xB9, 0x61, 0x8E, 0x1C, 0x9A, 0x1F),
358     TO_ECC_64(0x92, 0x9A, 0x21, 0xA0, 0xB6, 0x85, 0x40, 0xEE),
359     TO_ECC_64(0xA2, 0xDA, 0x72, 0x5B, 0x99, 0xB3, 0x15, 0xF3),
360     TO_ECC_64(0xB8, 0xB4, 0x89, 0x91, 0x8E, 0xF1, 0x09, 0xE1),
361     TO_ECC_64(0x56, 0x19, 0x39, 0x51, 0xEC, 0x7E, 0x93, 0x7B),
362     TO_ECC_64(0x16, 0x52, 0xC0, 0xBD, 0x3B, 0xB1, 0xBF, 0x07),
363     TO_ECC_64(0x35, 0x73, 0xDF, 0x88, 0x3D, 0x2C, 0x34, 0xF1),
364     TO_ECC_64(0xEF, 0x45, 0x1F, 0xD4, 0x6B, 0x50, 0x3F, 0x00)));
365 ECC_CONST(NIST_P521_gX, 66, TO_ECC_528(
366     TO_ECC_16(0x00, 0xC6),
367     TO_ECC_64(0x85, 0x8E, 0x06, 0xB7, 0x04, 0x04, 0xE9, 0xCD),
368     TO_ECC_64(0x9E, 0x3E, 0xCB, 0x66, 0x23, 0x95, 0xB4, 0x42),
369     TO_ECC_64(0x9C, 0x64, 0x81, 0x39, 0x05, 0x3F, 0xB5, 0x21),
370     TO_ECC_64(0xF8, 0x28, 0xAF, 0x60, 0x6B, 0x4D, 0x3D, 0xBA),
371     TO_ECC_64(0xA1, 0x4B, 0x5E, 0x77, 0xEF, 0xE7, 0x59, 0x28),
372     TO_ECC_64(0xFE, 0x1D, 0xC1, 0x27, 0xA2, 0xFF, 0xA8, 0xDE),
373     TO_ECC_64(0x33, 0x48, 0xB3, 0xC1, 0x85, 0x6A, 0x42, 0x9B),
374     TO_ECC_64(0xF9, 0x7E, 0x7E, 0x31, 0xC2, 0xE5, 0xBD, 0x66)));
375 ECC_CONST(NIST_P521_gY, 66, TO_ECC_528(
376     TO_ECC_16(0x01, 0x18),
377     TO_ECC_64(0x39, 0x29, 0x6A, 0x78, 0x9A, 0x3B, 0xC0, 0x04),
378     TO_ECC_64(0x5C, 0x8A, 0x5F, 0xB4, 0x2C, 0x7D, 0x1B, 0xD9),
379     TO_ECC_64(0x98, 0xF5, 0x44, 0x49, 0x57, 0x9B, 0x44, 0x68),
380     TO_ECC_64(0x17, 0xAF, 0xBD, 0x17, 0x27, 0x3E, 0x66, 0x2C),
381     TO_ECC_64(0x97, 0xEE, 0x72, 0x99, 0x5E, 0xF4, 0x26, 0x40),
382     TO_ECC_64(0xC5, 0x50, 0xB9, 0x01, 0x3F, 0xAD, 0x07, 0x61),
383     TO_ECC_64(0x35, 0x3C, 0x70, 0x86, 0xA2, 0x72, 0xC2, 0x40),
384     TO_ECC_64(0x88, 0xBE, 0x94, 0x76, 0x9F, 0xD1, 0x66, 0x50)));
385 ECC_CONST(NIST_P521_n, 66, TO_ECC_528(
386     TO_ECC_16(0x01, 0xFF),
387     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
388     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
389     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
390     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA),
391     TO_ECC_64(0x51, 0x86, 0x87, 0x83, 0xBF, 0x2F, 0x96, 0x6B),
392     TO_ECC_64(0x7F, 0xCC, 0x01, 0x48, 0xF7, 0x09, 0xA5, 0xD0),
393     TO_ECC_64(0x3B, 0xB5, 0xC9, 0xB8, 0x89, 0x9C, 0x47, 0xAE),
394     TO_ECC_64(0xBB, 0x6F, 0xB7, 0x1E, 0x91, 0x38, 0x64, 0x09)));
395 #define NIST_P521_h         ECC_ONE
396 #define NIST_P521_gZ        ECC_ONE
397 
398 #if USE_BN_ECC_DATA
399     const ECC_CURVE_DATA NIST_P521 = {
400         (bigNum)&NIST_P521_p, (bigNum)&NIST_P521_n, (bigNum)&NIST_P521_h,
401         (bigNum)&NIST_P521_a, (bigNum)&NIST_P521_b,
402         {(bigNum)&NIST_P521_gX, (bigNum)&NIST_P521_gY, (bigNum)&NIST_P521_gZ}};
403 
404 #else
405     const ECC_CURVE_DATA NIST_P521 = {
406         &NIST_P521_p.b, &NIST_P521_n.b, &NIST_P521_h.b,
407         &NIST_P521_a.b, &NIST_P521_b.b,
408         {&NIST_P521_gX.b, &NIST_P521_gY.b, &NIST_P521_gZ.b}};
409 
410 #endif // USE_BN_ECC_DATA
411 
412 #endif // ECC_NIST_P521
413 
414 
415 #if ECC_BN_P256
416 ECC_CONST(BN_P256_p, 32, TO_ECC_256(
417     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD),
418     TO_ECC_64(0x46, 0xE5, 0xF2, 0x5E, 0xEE, 0x71, 0xA4, 0x9F),
419     TO_ECC_64(0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82),
420     TO_ECC_64(0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13)));
421 #define BN_P256_a           ECC_ZERO
422 ECC_CONST(BN_P256_b, 1, TO_ECC_8(3));
423 #define BN_P256_gX          ECC_ONE
424 ECC_CONST(BN_P256_gY, 1, TO_ECC_8(2));
425 ECC_CONST(BN_P256_n, 32, TO_ECC_256(
426     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD),
427     TO_ECC_64(0x46, 0xE5, 0xF2, 0x5E, 0xEE, 0x71, 0xA4, 0x9E),
428     TO_ECC_64(0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99, 0x92, 0x1A),
429     TO_ECC_64(0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D)));
430 #define BN_P256_h           ECC_ONE
431 #define BN_P256_gZ          ECC_ONE
432 
433 #if USE_BN_ECC_DATA
434     const ECC_CURVE_DATA BN_P256 = {
435         (bigNum)&BN_P256_p, (bigNum)&BN_P256_n, (bigNum)&BN_P256_h,
436         (bigNum)&BN_P256_a, (bigNum)&BN_P256_b,
437         {(bigNum)&BN_P256_gX, (bigNum)&BN_P256_gY, (bigNum)&BN_P256_gZ}};
438 
439 #else
440     const ECC_CURVE_DATA BN_P256 = {
441         &BN_P256_p.b, &BN_P256_n.b, &BN_P256_h.b,
442         &BN_P256_a.b, &BN_P256_b.b,
443         {&BN_P256_gX.b, &BN_P256_gY.b, &BN_P256_gZ.b}};
444 
445 #endif // USE_BN_ECC_DATA
446 
447 #endif // ECC_BN_P256
448 
449 
450 #if ECC_BN_P638
451 ECC_CONST(BN_P638_p, 80, TO_ECC_640(
452     TO_ECC_64(0x23, 0xFF, 0xFF, 0xFD, 0xC0, 0x00, 0x00, 0x0D),
453     TO_ECC_64(0x7F, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x01, 0xD3),
454     TO_ECC_64(0xFF, 0xFF, 0xF9, 0x42, 0xD0, 0x00, 0x16, 0x5E),
455     TO_ECC_64(0x3F, 0xFF, 0x94, 0x87, 0x00, 0x00, 0xD5, 0x2F),
456     TO_ECC_64(0xFF, 0xFD, 0xD0, 0xE0, 0x00, 0x08, 0xDE, 0x55),
457     TO_ECC_64(0xC0, 0x00, 0x86, 0x52, 0x00, 0x21, 0xE5, 0x5B),
458     TO_ECC_64(0xFF, 0xFF, 0xF5, 0x1F, 0xFF, 0xF4, 0xEB, 0x80),
459     TO_ECC_64(0x00, 0x00, 0x00, 0x4C, 0x80, 0x01, 0x5A, 0xCD),
460     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xE0),
461     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67)));
462 #define BN_P638_a           ECC_ZERO
463 ECC_CONST(BN_P638_b, 2, TO_ECC_16(0x01,0x01));
464 ECC_CONST(BN_P638_gX, 80, TO_ECC_640(
465     TO_ECC_64(0x23, 0xFF, 0xFF, 0xFD, 0xC0, 0x00, 0x00, 0x0D),
466     TO_ECC_64(0x7F, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x01, 0xD3),
467     TO_ECC_64(0xFF, 0xFF, 0xF9, 0x42, 0xD0, 0x00, 0x16, 0x5E),
468     TO_ECC_64(0x3F, 0xFF, 0x94, 0x87, 0x00, 0x00, 0xD5, 0x2F),
469     TO_ECC_64(0xFF, 0xFD, 0xD0, 0xE0, 0x00, 0x08, 0xDE, 0x55),
470     TO_ECC_64(0xC0, 0x00, 0x86, 0x52, 0x00, 0x21, 0xE5, 0x5B),
471     TO_ECC_64(0xFF, 0xFF, 0xF5, 0x1F, 0xFF, 0xF4, 0xEB, 0x80),
472     TO_ECC_64(0x00, 0x00, 0x00, 0x4C, 0x80, 0x01, 0x5A, 0xCD),
473     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xE0),
474     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66)));
475 ECC_CONST(BN_P638_gY, 1, TO_ECC_8(0x10));
476 ECC_CONST(BN_P638_n, 80, TO_ECC_640(
477     TO_ECC_64(0x23, 0xFF, 0xFF, 0xFD, 0xC0, 0x00, 0x00, 0x0D),
478     TO_ECC_64(0x7F, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x01, 0xD3),
479     TO_ECC_64(0xFF, 0xFF, 0xF9, 0x42, 0xD0, 0x00, 0x16, 0x5E),
480     TO_ECC_64(0x3F, 0xFF, 0x94, 0x87, 0x00, 0x00, 0xD5, 0x2F),
481     TO_ECC_64(0xFF, 0xFD, 0xD0, 0xE0, 0x00, 0x08, 0xDE, 0x55),
482     TO_ECC_64(0x60, 0x00, 0x86, 0x55, 0x00, 0x21, 0xE5, 0x55),
483     TO_ECC_64(0xFF, 0xFF, 0xF5, 0x4F, 0xFF, 0xF4, 0xEA, 0xC0),
484     TO_ECC_64(0x00, 0x00, 0x00, 0x49, 0x80, 0x01, 0x54, 0xD9),
485     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xA0),
486     TO_ECC_64(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61)));
487 #define BN_P638_h           ECC_ONE
488 #define BN_P638_gZ          ECC_ONE
489 
490 #if USE_BN_ECC_DATA
491     const ECC_CURVE_DATA BN_P638 = {
492         (bigNum)&BN_P638_p, (bigNum)&BN_P638_n, (bigNum)&BN_P638_h,
493         (bigNum)&BN_P638_a, (bigNum)&BN_P638_b,
494         {(bigNum)&BN_P638_gX, (bigNum)&BN_P638_gY, (bigNum)&BN_P638_gZ}};
495 
496 #else
497     const ECC_CURVE_DATA BN_P638 = {
498         &BN_P638_p.b, &BN_P638_n.b, &BN_P638_h.b,
499         &BN_P638_a.b, &BN_P638_b.b,
500         {&BN_P638_gX.b, &BN_P638_gY.b, &BN_P638_gZ.b}};
501 
502 #endif // USE_BN_ECC_DATA
503 
504 #endif // ECC_BN_P638
505 
506 
507 #if ECC_SM2_P256
508 ECC_CONST(SM2_P256_p, 32, TO_ECC_256(
509     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF),
510     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
511     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00),
512     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)));
513 ECC_CONST(SM2_P256_a, 32, TO_ECC_256(
514     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF),
515     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
516     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00),
517     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC)));
518 ECC_CONST(SM2_P256_b, 32, TO_ECC_256(
519     TO_ECC_64(0x28, 0xE9, 0xFA, 0x9E, 0x9D, 0x9F, 0x5E, 0x34),
520     TO_ECC_64(0x4D, 0x5A, 0x9E, 0x4B, 0xCF, 0x65, 0x09, 0xA7),
521     TO_ECC_64(0xF3, 0x97, 0x89, 0xF5, 0x15, 0xAB, 0x8F, 0x92),
522     TO_ECC_64(0xDD, 0xBC, 0xBD, 0x41, 0x4D, 0x94, 0x0E, 0x93)));
523 ECC_CONST(SM2_P256_gX, 32, TO_ECC_256(
524     TO_ECC_64(0x32, 0xC4, 0xAE, 0x2C, 0x1F, 0x19, 0x81, 0x19),
525     TO_ECC_64(0x5F, 0x99, 0x04, 0x46, 0x6A, 0x39, 0xC9, 0x94),
526     TO_ECC_64(0x8F, 0xE3, 0x0B, 0xBF, 0xF2, 0x66, 0x0B, 0xE1),
527     TO_ECC_64(0x71, 0x5A, 0x45, 0x89, 0x33, 0x4C, 0x74, 0xC7)));
528 ECC_CONST(SM2_P256_gY, 32, TO_ECC_256(
529     TO_ECC_64(0xBC, 0x37, 0x36, 0xA2, 0xF4, 0xF6, 0x77, 0x9C),
530     TO_ECC_64(0x59, 0xBD, 0xCE, 0xE3, 0x6B, 0x69, 0x21, 0x53),
531     TO_ECC_64(0xD0, 0xA9, 0x87, 0x7C, 0xC6, 0x2A, 0x47, 0x40),
532     TO_ECC_64(0x02, 0xDF, 0x32, 0xE5, 0x21, 0x39, 0xF0, 0xA0)));
533 ECC_CONST(SM2_P256_n, 32, TO_ECC_256(
534     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF),
535     TO_ECC_64(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
536     TO_ECC_64(0x72, 0x03, 0xDF, 0x6B, 0x21, 0xC6, 0x05, 0x2B),
537     TO_ECC_64(0x53, 0xBB, 0xF4, 0x09, 0x39, 0xD5, 0x41, 0x23)));
538 #define SM2_P256_h          ECC_ONE
539 #define SM2_P256_gZ         ECC_ONE
540 
541 #if USE_BN_ECC_DATA
542     const ECC_CURVE_DATA SM2_P256 = {
543         (bigNum)&SM2_P256_p, (bigNum)&SM2_P256_n, (bigNum)&SM2_P256_h,
544         (bigNum)&SM2_P256_a, (bigNum)&SM2_P256_b,
545         {(bigNum)&SM2_P256_gX, (bigNum)&SM2_P256_gY, (bigNum)&SM2_P256_gZ}};
546 
547 #else
548     const ECC_CURVE_DATA SM2_P256 = {
549         &SM2_P256_p.b, &SM2_P256_n.b, &SM2_P256_h.b,
550         &SM2_P256_a.b, &SM2_P256_b.b,
551         {&SM2_P256_gX.b, &SM2_P256_gY.b, &SM2_P256_gZ.b}};
552 
553 #endif // USE_BN_ECC_DATA
554 
555 #endif // ECC_SM2_P256
556 
557 
558 #define comma
559 const ECC_CURVE   eccCurves[] = {
560 #if ECC_NIST_P192
561     comma
562     {TPM_ECC_NIST_P192,
563     192,
564     {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SHA256}}},
565     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
566     &NIST_P192,
567     OID_ECC_NIST_P192
568     CURVE_NAME("NIST_P192")}
569 #   undef comma
570 #   define comma ,
571 #endif // ECC_NIST_P192
572 #if ECC_NIST_P224
573     comma
574     {TPM_ECC_NIST_P224,
575     224,
576     {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SHA256}}},
577     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
578     &NIST_P224,
579     OID_ECC_NIST_P224
580     CURVE_NAME("NIST_P224")}
581 #   undef comma
582 #   define comma ,
583 #endif // ECC_NIST_P224
584 #if ECC_NIST_P256
585     comma
586     {TPM_ECC_NIST_P256,
587     256,
588     {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SHA256}}},
589     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
590     &NIST_P256,
591     OID_ECC_NIST_P256
592     CURVE_NAME("NIST_P256")}
593 #   undef comma
594 #   define comma ,
595 #endif // ECC_NIST_P256
596 #if ECC_NIST_P384
597     comma
598     {TPM_ECC_NIST_P384,
599     384,
600     {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SHA384}}},
601     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
602     &NIST_P384,
603     OID_ECC_NIST_P384
604     CURVE_NAME("NIST_P384")}
605 #   undef comma
606 #   define comma ,
607 #endif // ECC_NIST_P384
608 #if ECC_NIST_P521
609     comma
610     {TPM_ECC_NIST_P521,
611     521,
612     {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SHA512}}},
613     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
614     &NIST_P521,
615     OID_ECC_NIST_P521
616     CURVE_NAME("NIST_P521")}
617 #   undef comma
618 #   define comma ,
619 #endif // ECC_NIST_P521
620 #if ECC_BN_P256
621     comma
622     {TPM_ECC_BN_P256,
623     256,
624     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
625     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
626     &BN_P256,
627     OID_ECC_BN_P256
628     CURVE_NAME("BN_P256")}
629 #   undef comma
630 #   define comma ,
631 #endif // ECC_BN_P256
632 #if ECC_BN_P638
633     comma
634     {TPM_ECC_BN_P638,
635     638,
636     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
637     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
638     &BN_P638,
639     OID_ECC_BN_P638
640     CURVE_NAME("BN_P638")}
641 #   undef comma
642 #   define comma ,
643 #endif // ECC_BN_P638
644 #if ECC_SM2_P256
645     comma
646     {TPM_ECC_SM2_P256,
647     256,
648     {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SM3_256}}},
649     {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
650     &SM2_P256,
651     OID_ECC_SM2_P256
652     CURVE_NAME("SM2_P256")}
653 #   undef comma
654 #   define comma ,
655 #endif // ECC_SM2_P256
656 };
657 #endif // TPM_ALG_ECC
658