]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/OpensslLib/EcSm2Null.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / CryptoPkg / Library / OpensslLib / EcSm2Null.c
1 /** @file
2 Null implementation of EC and SM2 functions called by BaseCryptLib.
3
4 Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include <Base.h>
10 #include <Library/DebugLib.h>
11
12 #undef OPENSSL_NO_EC
13
14 #include <openssl/objects.h>
15 #include <openssl/bn.h>
16 #include <openssl/ec.h>
17 #include <openssl/pem.h>
18
19 void
20 EC_GROUP_free (
21 EC_GROUP *group
22 )
23 {
24 ASSERT (FALSE);
25 }
26
27 int
28 EC_GROUP_get_order (
29 const EC_GROUP *group,
30 BIGNUM *order,
31 BN_CTX *ctx
32 )
33 {
34 ASSERT (FALSE);
35 return 0;
36 }
37
38 int
39 EC_GROUP_get_curve_name (
40 const EC_GROUP *group
41 )
42 {
43 ASSERT (FALSE);
44 return 0;
45 }
46
47 int
48 EC_GROUP_get_curve (
49 const EC_GROUP *group,
50 BIGNUM *p,
51 BIGNUM *a,
52 BIGNUM *b,
53 BN_CTX *ctx
54 )
55 {
56 ASSERT (FALSE);
57 return 0;
58 }
59
60 int
61 EC_GROUP_get_degree (
62 const EC_GROUP *group
63 )
64 {
65 ASSERT (FALSE);
66 return 0;
67 }
68
69 EC_GROUP *
70 EC_GROUP_new_by_curve_name (
71 int nid
72 )
73 {
74 ASSERT (FALSE);
75 return NULL;
76 }
77
78 EC_POINT *
79 EC_POINT_new (
80 const EC_GROUP *group
81 )
82 {
83 ASSERT (FALSE);
84 return NULL;
85 }
86
87 void
88 EC_POINT_free (
89 EC_POINT *point
90 )
91 {
92 ASSERT (FALSE);
93 }
94
95 void
96 EC_POINT_clear_free (
97 EC_POINT *point
98 )
99 {
100 ASSERT (FALSE);
101 }
102
103 int
104 EC_POINT_set_affine_coordinates (
105 const EC_GROUP *group,
106 EC_POINT *p,
107 const BIGNUM *x,
108 const BIGNUM *y,
109 BN_CTX *ctx
110 )
111 {
112 ASSERT (FALSE);
113 return 0;
114 }
115
116 int
117 EC_POINT_get_affine_coordinates (
118 const EC_GROUP *group,
119 const EC_POINT *p,
120 BIGNUM *x,
121 BIGNUM *y,
122 BN_CTX *ctx
123 )
124 {
125 ASSERT (FALSE);
126 return 0;
127 }
128
129 int
130 EC_POINT_set_compressed_coordinates (
131 const EC_GROUP *group,
132 EC_POINT *p,
133 const BIGNUM *x,
134 int y_bit,
135 BN_CTX *ctx
136 )
137 {
138 ASSERT (FALSE);
139 return 0;
140 }
141
142 int
143 EC_POINT_add (
144 const EC_GROUP *group,
145 EC_POINT *r,
146 const EC_POINT *a,
147 const EC_POINT *b,
148 BN_CTX *ctx
149 )
150 {
151 ASSERT (FALSE);
152 return 0;
153 }
154
155 int
156 EC_POINT_invert (
157 const EC_GROUP *group,
158 EC_POINT *a,
159 BN_CTX *ctx
160 )
161 {
162 ASSERT (FALSE);
163 return 0;
164 }
165
166 int
167 EC_POINT_is_at_infinity (
168 const EC_GROUP *group,
169 const EC_POINT *p
170 )
171 {
172 ASSERT (FALSE);
173 return 0;
174 }
175
176 int
177 EC_POINT_is_on_curve (
178 const EC_GROUP *group,
179 const EC_POINT *point,
180 BN_CTX *ctx
181 )
182 {
183 ASSERT (FALSE);
184 return -1;
185 }
186
187 int
188 EC_POINT_cmp (
189 const EC_GROUP *group,
190 const EC_POINT *a,
191 const EC_POINT *b,
192 BN_CTX *ctx
193 )
194 {
195 ASSERT (FALSE);
196 return -1;
197 }
198
199 int
200 EC_POINT_mul (
201 const EC_GROUP *group,
202 EC_POINT *r,
203 const BIGNUM *n,
204 const EC_POINT *q,
205 const BIGNUM *m,
206 BN_CTX *ctx
207 )
208 {
209 ASSERT (FALSE);
210 return -0;
211 }
212
213 EC_KEY *
214 EC_KEY_new_by_curve_name (
215 int nid
216 )
217 {
218 ASSERT (FALSE);
219 return NULL;
220 }
221
222 void
223 EC_KEY_free (
224 EC_KEY *key
225 )
226 {
227 ASSERT (FALSE);
228 }
229
230 EC_KEY *
231 EC_KEY_dup (
232 const EC_KEY *src
233 )
234 {
235 ASSERT (FALSE);
236 return NULL;
237 }
238
239 const EC_GROUP *
240 EC_KEY_get0_group (
241 const EC_KEY *key
242 )
243 {
244 ASSERT (FALSE);
245 return NULL;
246 }
247
248 const EC_POINT *
249 EC_KEY_get0_public_key (
250 const EC_KEY *key
251 )
252 {
253 ASSERT (FALSE);
254 return NULL;
255 }
256
257 int
258 EC_KEY_set_public_key (
259 EC_KEY *key,
260 const EC_POINT *pub
261 )
262 {
263 ASSERT (FALSE);
264 return 0;
265 }
266
267 int
268 EC_KEY_generate_key (
269 EC_KEY *key
270 )
271 {
272 ASSERT (FALSE);
273 return 0;
274 }
275
276 int
277 EC_KEY_check_key (
278 const EC_KEY *key
279 )
280 {
281 ASSERT (FALSE);
282 return 0;
283 }
284
285 int
286 ECDH_compute_key (
287 void *out,
288 size_t outlen,
289 const EC_POINT *pub_key,
290 const EC_KEY *ecdh,
291 void *(*KDF)(
292 const void *in,
293 size_t inlen,
294 void *out,
295 size_t *outlen
296 )
297 )
298 {
299 ASSERT (FALSE);
300 return 0;
301 }
302
303 struct ec_key_st *
304 EVP_PKEY_get0_EC_KEY (
305 EVP_PKEY *pkey
306 )
307 {
308 ASSERT (FALSE);
309 return NULL;
310 }
311
312 EC_KEY *
313 PEM_read_bio_ECPrivateKey (
314 BIO *bp,
315 EC_KEY **key,
316 pem_password_cb *cb,
317 void *u
318 )
319 {
320 ASSERT (FALSE);
321 return NULL;
322 }
323
324 ECDSA_SIG *
325 ECDSA_SIG_new (
326 void
327 )
328 {
329 ASSERT (FALSE);
330 return NULL;
331 }
332
333 void
334 ECDSA_SIG_free (
335 ECDSA_SIG *sig
336 )
337 {
338 ASSERT (FALSE);
339 }
340
341 void
342 ECDSA_SIG_get0 (
343 const ECDSA_SIG *sig,
344 const BIGNUM **pr,
345 const BIGNUM **ps
346 )
347 {
348 ASSERT (FALSE);
349 }
350
351 int
352 ECDSA_SIG_set0 (
353 ECDSA_SIG *sig,
354 BIGNUM *r,
355 BIGNUM *s
356 )
357 {
358 return 0;
359 ASSERT (FALSE);
360 }
361
362 ECDSA_SIG *
363 ECDSA_do_sign (
364 const unsigned char *dgst,
365 int dgst_len,
366 EC_KEY *eckey
367 )
368 {
369 ASSERT (FALSE);
370 return NULL;
371 }
372
373 int
374 ECDSA_do_verify (
375 const unsigned char *dgst,
376 int dgst_len,
377 const ECDSA_SIG *sig,
378 EC_KEY *eckey
379 )
380 {
381 ASSERT (FALSE);
382 return -1;
383 }