xref: /freebsd/crypto/openssl/providers/common/include/prov/der_ec.h (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
1 /*
2  * WARNING: do not edit!
3  * Generated by Makefile from providers/common/include/prov/der_ec.h.in
4  *
5  * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
6  *
7  * Licensed under the Apache License 2.0 (the "License").  You may not use
8  * this file except in compliance with the License.  You can obtain a copy
9  * in the file LICENSE in the source distribution or at
10  * https://www.openssl.org/source/license.html
11  */
12 
13 #include "crypto/ec.h"
14 #include "internal/der.h"
15 
16 /* Well known OIDs precompiled */
17 
18 /*
19  * ecdsa-with-SHA1 OBJECT IDENTIFIER ::= { id-ecSigType 1 }
20  */
21 #define DER_OID_V_ecdsa_with_SHA1 DER_P_OBJECT, 7, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x01
22 #define DER_OID_SZ_ecdsa_with_SHA1 9
23 extern const unsigned char ossl_der_oid_ecdsa_with_SHA1[DER_OID_SZ_ecdsa_with_SHA1];
24 
25 /*
26  * id-ecPublicKey OBJECT IDENTIFIER ::= { id-publicKeyType 1 }
27  */
28 #define DER_OID_V_id_ecPublicKey DER_P_OBJECT, 7, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01
29 #define DER_OID_SZ_id_ecPublicKey 9
30 extern const unsigned char ossl_der_oid_id_ecPublicKey[DER_OID_SZ_id_ecPublicKey];
31 
32 /*
33  * c2pnb163v1  OBJECT IDENTIFIER  ::=  { c-TwoCurve  1 }
34  */
35 #define DER_OID_V_c2pnb163v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x01
36 #define DER_OID_SZ_c2pnb163v1 10
37 extern const unsigned char ossl_der_oid_c2pnb163v1[DER_OID_SZ_c2pnb163v1];
38 
39 /*
40  * c2pnb163v2  OBJECT IDENTIFIER  ::=  { c-TwoCurve  2 }
41  */
42 #define DER_OID_V_c2pnb163v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x02
43 #define DER_OID_SZ_c2pnb163v2 10
44 extern const unsigned char ossl_der_oid_c2pnb163v2[DER_OID_SZ_c2pnb163v2];
45 
46 /*
47  * c2pnb163v3  OBJECT IDENTIFIER  ::=  { c-TwoCurve  3 }
48  */
49 #define DER_OID_V_c2pnb163v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x03
50 #define DER_OID_SZ_c2pnb163v3 10
51 extern const unsigned char ossl_der_oid_c2pnb163v3[DER_OID_SZ_c2pnb163v3];
52 
53 /*
54  * c2pnb176w1  OBJECT IDENTIFIER  ::=  { c-TwoCurve  4 }
55  */
56 #define DER_OID_V_c2pnb176w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x04
57 #define DER_OID_SZ_c2pnb176w1 10
58 extern const unsigned char ossl_der_oid_c2pnb176w1[DER_OID_SZ_c2pnb176w1];
59 
60 /*
61  * c2tnb191v1  OBJECT IDENTIFIER  ::=  { c-TwoCurve  5 }
62  */
63 #define DER_OID_V_c2tnb191v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x05
64 #define DER_OID_SZ_c2tnb191v1 10
65 extern const unsigned char ossl_der_oid_c2tnb191v1[DER_OID_SZ_c2tnb191v1];
66 
67 /*
68  * c2tnb191v2  OBJECT IDENTIFIER  ::=  { c-TwoCurve  6 }
69  */
70 #define DER_OID_V_c2tnb191v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x06
71 #define DER_OID_SZ_c2tnb191v2 10
72 extern const unsigned char ossl_der_oid_c2tnb191v2[DER_OID_SZ_c2tnb191v2];
73 
74 /*
75  * c2tnb191v3  OBJECT IDENTIFIER  ::=  { c-TwoCurve  7 }
76  */
77 #define DER_OID_V_c2tnb191v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x07
78 #define DER_OID_SZ_c2tnb191v3 10
79 extern const unsigned char ossl_der_oid_c2tnb191v3[DER_OID_SZ_c2tnb191v3];
80 
81 /*
82  * c2onb191v4  OBJECT IDENTIFIER  ::=  { c-TwoCurve  8 }
83  */
84 #define DER_OID_V_c2onb191v4 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x08
85 #define DER_OID_SZ_c2onb191v4 10
86 extern const unsigned char ossl_der_oid_c2onb191v4[DER_OID_SZ_c2onb191v4];
87 
88 /*
89  * c2onb191v5  OBJECT IDENTIFIER  ::=  { c-TwoCurve  9 }
90  */
91 #define DER_OID_V_c2onb191v5 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x09
92 #define DER_OID_SZ_c2onb191v5 10
93 extern const unsigned char ossl_der_oid_c2onb191v5[DER_OID_SZ_c2onb191v5];
94 
95 /*
96  * c2pnb208w1  OBJECT IDENTIFIER  ::=  { c-TwoCurve 10 }
97  */
98 #define DER_OID_V_c2pnb208w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0A
99 #define DER_OID_SZ_c2pnb208w1 10
100 extern const unsigned char ossl_der_oid_c2pnb208w1[DER_OID_SZ_c2pnb208w1];
101 
102 /*
103  * c2tnb239v1  OBJECT IDENTIFIER  ::=  { c-TwoCurve 11 }
104  */
105 #define DER_OID_V_c2tnb239v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0B
106 #define DER_OID_SZ_c2tnb239v1 10
107 extern const unsigned char ossl_der_oid_c2tnb239v1[DER_OID_SZ_c2tnb239v1];
108 
109 /*
110  * c2tnb239v2  OBJECT IDENTIFIER  ::=  { c-TwoCurve 12 }
111  */
112 #define DER_OID_V_c2tnb239v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0C
113 #define DER_OID_SZ_c2tnb239v2 10
114 extern const unsigned char ossl_der_oid_c2tnb239v2[DER_OID_SZ_c2tnb239v2];
115 
116 /*
117  * c2tnb239v3  OBJECT IDENTIFIER  ::=  { c-TwoCurve 13 }
118  */
119 #define DER_OID_V_c2tnb239v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0D
120 #define DER_OID_SZ_c2tnb239v3 10
121 extern const unsigned char ossl_der_oid_c2tnb239v3[DER_OID_SZ_c2tnb239v3];
122 
123 /*
124  * c2onb239v4  OBJECT IDENTIFIER  ::=  { c-TwoCurve 14 }
125  */
126 #define DER_OID_V_c2onb239v4 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0E
127 #define DER_OID_SZ_c2onb239v4 10
128 extern const unsigned char ossl_der_oid_c2onb239v4[DER_OID_SZ_c2onb239v4];
129 
130 /*
131  * c2onb239v5  OBJECT IDENTIFIER  ::=  { c-TwoCurve 15 }
132  */
133 #define DER_OID_V_c2onb239v5 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0F
134 #define DER_OID_SZ_c2onb239v5 10
135 extern const unsigned char ossl_der_oid_c2onb239v5[DER_OID_SZ_c2onb239v5];
136 
137 /*
138  * c2pnb272w1  OBJECT IDENTIFIER  ::=  { c-TwoCurve 16 }
139  */
140 #define DER_OID_V_c2pnb272w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x10
141 #define DER_OID_SZ_c2pnb272w1 10
142 extern const unsigned char ossl_der_oid_c2pnb272w1[DER_OID_SZ_c2pnb272w1];
143 
144 /*
145  * c2pnb304w1  OBJECT IDENTIFIER  ::=  { c-TwoCurve 17 }
146  */
147 #define DER_OID_V_c2pnb304w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x11
148 #define DER_OID_SZ_c2pnb304w1 10
149 extern const unsigned char ossl_der_oid_c2pnb304w1[DER_OID_SZ_c2pnb304w1];
150 
151 /*
152  * c2tnb359v1  OBJECT IDENTIFIER  ::=  { c-TwoCurve 18 }
153  */
154 #define DER_OID_V_c2tnb359v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x12
155 #define DER_OID_SZ_c2tnb359v1 10
156 extern const unsigned char ossl_der_oid_c2tnb359v1[DER_OID_SZ_c2tnb359v1];
157 
158 /*
159  * c2pnb368w1  OBJECT IDENTIFIER  ::=  { c-TwoCurve 19 }
160  */
161 #define DER_OID_V_c2pnb368w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x13
162 #define DER_OID_SZ_c2pnb368w1 10
163 extern const unsigned char ossl_der_oid_c2pnb368w1[DER_OID_SZ_c2pnb368w1];
164 
165 /*
166  * c2tnb431r1  OBJECT IDENTIFIER  ::=  { c-TwoCurve 20 }
167  */
168 #define DER_OID_V_c2tnb431r1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x14
169 #define DER_OID_SZ_c2tnb431r1 10
170 extern const unsigned char ossl_der_oid_c2tnb431r1[DER_OID_SZ_c2tnb431r1];
171 
172 /*
173  * prime192v1  OBJECT IDENTIFIER  ::=  { primeCurve  1 }
174  */
175 #define DER_OID_V_prime192v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x01
176 #define DER_OID_SZ_prime192v1 10
177 extern const unsigned char ossl_der_oid_prime192v1[DER_OID_SZ_prime192v1];
178 
179 /*
180  * prime192v2  OBJECT IDENTIFIER  ::=  { primeCurve  2 }
181  */
182 #define DER_OID_V_prime192v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x02
183 #define DER_OID_SZ_prime192v2 10
184 extern const unsigned char ossl_der_oid_prime192v2[DER_OID_SZ_prime192v2];
185 
186 /*
187  * prime192v3  OBJECT IDENTIFIER  ::=  { primeCurve  3 }
188  */
189 #define DER_OID_V_prime192v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x03
190 #define DER_OID_SZ_prime192v3 10
191 extern const unsigned char ossl_der_oid_prime192v3[DER_OID_SZ_prime192v3];
192 
193 /*
194  * prime239v1  OBJECT IDENTIFIER  ::=  { primeCurve  4 }
195  */
196 #define DER_OID_V_prime239v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x04
197 #define DER_OID_SZ_prime239v1 10
198 extern const unsigned char ossl_der_oid_prime239v1[DER_OID_SZ_prime239v1];
199 
200 /*
201  * prime239v2  OBJECT IDENTIFIER  ::=  { primeCurve  5 }
202  */
203 #define DER_OID_V_prime239v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x05
204 #define DER_OID_SZ_prime239v2 10
205 extern const unsigned char ossl_der_oid_prime239v2[DER_OID_SZ_prime239v2];
206 
207 /*
208  * prime239v3  OBJECT IDENTIFIER  ::=  { primeCurve  6 }
209  */
210 #define DER_OID_V_prime239v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x06
211 #define DER_OID_SZ_prime239v3 10
212 extern const unsigned char ossl_der_oid_prime239v3[DER_OID_SZ_prime239v3];
213 
214 /*
215  * prime256v1  OBJECT IDENTIFIER  ::=  { primeCurve  7 }
216  */
217 #define DER_OID_V_prime256v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07
218 #define DER_OID_SZ_prime256v1 10
219 extern const unsigned char ossl_der_oid_prime256v1[DER_OID_SZ_prime256v1];
220 
221 /*
222  * ecdsa-with-SHA224 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
223  *      us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 1 }
224  */
225 #define DER_OID_V_ecdsa_with_SHA224 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x01
226 #define DER_OID_SZ_ecdsa_with_SHA224 10
227 extern const unsigned char ossl_der_oid_ecdsa_with_SHA224[DER_OID_SZ_ecdsa_with_SHA224];
228 
229 /*
230  * ecdsa-with-SHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
231  *      us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 2 }
232  */
233 #define DER_OID_V_ecdsa_with_SHA256 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02
234 #define DER_OID_SZ_ecdsa_with_SHA256 10
235 extern const unsigned char ossl_der_oid_ecdsa_with_SHA256[DER_OID_SZ_ecdsa_with_SHA256];
236 
237 /*
238  * ecdsa-with-SHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
239  *      us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 3 }
240  */
241 #define DER_OID_V_ecdsa_with_SHA384 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x03
242 #define DER_OID_SZ_ecdsa_with_SHA384 10
243 extern const unsigned char ossl_der_oid_ecdsa_with_SHA384[DER_OID_SZ_ecdsa_with_SHA384];
244 
245 /*
246  * ecdsa-with-SHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
247  *      us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 4 }
248  */
249 #define DER_OID_V_ecdsa_with_SHA512 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x04
250 #define DER_OID_SZ_ecdsa_with_SHA512 10
251 extern const unsigned char ossl_der_oid_ecdsa_with_SHA512[DER_OID_SZ_ecdsa_with_SHA512];
252 
253 /*
254  * id-ecdsa-with-sha3-224 OBJECT IDENTIFIER ::= { sigAlgs 9 }
255  */
256 #define DER_OID_V_id_ecdsa_with_sha3_224 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x09
257 #define DER_OID_SZ_id_ecdsa_with_sha3_224 11
258 extern const unsigned char ossl_der_oid_id_ecdsa_with_sha3_224[DER_OID_SZ_id_ecdsa_with_sha3_224];
259 
260 /*
261  * id-ecdsa-with-sha3-256 OBJECT IDENTIFIER ::= { sigAlgs 10 }
262  */
263 #define DER_OID_V_id_ecdsa_with_sha3_256 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0A
264 #define DER_OID_SZ_id_ecdsa_with_sha3_256 11
265 extern const unsigned char ossl_der_oid_id_ecdsa_with_sha3_256[DER_OID_SZ_id_ecdsa_with_sha3_256];
266 
267 /*
268  * id-ecdsa-with-sha3-384 OBJECT IDENTIFIER ::= { sigAlgs 11 }
269  */
270 #define DER_OID_V_id_ecdsa_with_sha3_384 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0B
271 #define DER_OID_SZ_id_ecdsa_with_sha3_384 11
272 extern const unsigned char ossl_der_oid_id_ecdsa_with_sha3_384[DER_OID_SZ_id_ecdsa_with_sha3_384];
273 
274 /*
275  * id-ecdsa-with-sha3-512 OBJECT IDENTIFIER ::= { sigAlgs 12 }
276  */
277 #define DER_OID_V_id_ecdsa_with_sha3_512 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0C
278 #define DER_OID_SZ_id_ecdsa_with_sha3_512 11
279 extern const unsigned char ossl_der_oid_id_ecdsa_with_sha3_512[DER_OID_SZ_id_ecdsa_with_sha3_512];
280 
281 
282 /* Subject Public Key Info */
283 int ossl_DER_w_algorithmIdentifier_EC(WPACKET *pkt, int cont, EC_KEY *ec);
284 /* Signature */
285 int ossl_DER_w_algorithmIdentifier_ECDSA_with_MD(WPACKET *pkt, int cont,
286                                                  EC_KEY *ec, int mdnid);
287