TianoCore EDK2 master
Loading...
Searching...
No Matches
EcSm2Null.c
Go to the documentation of this file.
1
9#include <Library/DebugLib.h>
10
11#include <mbedtls/ecp.h>
12#include <mbedtls/ecdh.h>
13#include <mbedtls/ecdsa.h>
14#include <mbedtls/bignum.h>
15#include <bignum_core.h>
16
17/*
18 * Get the curve info for the internal identifier
19 */
20const mbedtls_ecp_curve_info *
21mbedtls_ecp_curve_info_from_grp_id (
22 mbedtls_ecp_group_id grp_id
23 )
24{
25 ASSERT (FALSE);
26 return (NULL);
27}
28
29void
30mbedtls_ecdh_init (
31 mbedtls_ecdh_context *ctx
32 )
33{
34 ASSERT (FALSE);
35}
36
37/*
38 * Free context
39 */
40void
41mbedtls_ecdh_free (
42 mbedtls_ecdh_context *ctx
43 )
44{
45 ASSERT (FALSE);
46}
47
48int
49mbedtls_ecdh_calc_secret (
50 mbedtls_ecdh_context *ctx,
51 size_t *olen,
52 unsigned char *buf,
53 size_t blen,
54 int ( *f_rng )(void *, unsigned char *, size_t),
55 void *p_rng
56 )
57{
58 ASSERT (FALSE);
59 return -1;
60}
61
62void
63mbedtls_ecp_keypair_init (
64 mbedtls_ecp_keypair *key
65 )
66{
67 ASSERT (FALSE);
68}
69
70void
71mbedtls_ecp_keypair_free (
72 mbedtls_ecp_keypair *key
73 )
74{
75 ASSERT (FALSE);
76}
77
78int
79mbedtls_ecp_check_pub_priv (
80 const mbedtls_ecp_keypair *pub,
81 const mbedtls_ecp_keypair *prv,
82 int ( *f_rng )(void *, unsigned char *, size_t),
83 void *p_rng
84 )
85{
86 ASSERT (FALSE);
87 return -1;
88}
89
90int
91mbedtls_ecdsa_write_signature (
92 mbedtls_ecdsa_context *ctx,
93 mbedtls_md_type_t md_alg,
94 const unsigned char *hash,
95 size_t hlen,
96 unsigned char *sig,
97 size_t sig_size,
98 size_t *slen,
99 int ( *f_rng )(void *, unsigned char *, size_t),
100 void *p_rng
101 )
102{
103 ASSERT (FALSE);
104 return -1;
105}
106
107int
108mbedtls_ecdsa_write_signature_restartable (
109 mbedtls_ecdsa_context *ctx,
110 mbedtls_md_type_t md_alg,
111 const unsigned char *hash,
112 size_t hlen,
113 unsigned char *sig,
114 size_t sig_size,
115 size_t *slen,
116 int ( *f_rng )(void *, unsigned char *, size_t),
117 void *p_rng,
118 mbedtls_ecdsa_restart_ctx *rs_ctx
119 )
120{
121 ASSERT (FALSE);
122 return -1;
123}
124
125int
126mbedtls_ecdsa_read_signature (
127 mbedtls_ecdsa_context *ctx,
128 const unsigned char *hash,
129 size_t hlen,
130 const unsigned char *sig,
131 size_t slen
132 )
133{
134 ASSERT (FALSE);
135 return -1;
136}
137
138int
139mbedtls_ecdsa_read_signature_restartable (
140 mbedtls_ecdsa_context *ctx,
141 const unsigned char *hash,
142 size_t hlen,
143 const unsigned char *sig,
144 size_t slen,
145 mbedtls_ecdsa_restart_ctx *rs_ctx
146 )
147{
148 ASSERT (FALSE);
149 return -1;
150}
151
152int
153mbedtls_ecdsa_from_keypair (
154 mbedtls_ecdsa_context *ctx,
155 const mbedtls_ecp_keypair *key
156 )
157{
158 ASSERT (FALSE);
159 return -1;
160}
161
162void
163mbedtls_ecdsa_init (
164 mbedtls_ecdsa_context *ctx
165 )
166{
167 ASSERT (FALSE);
168}
169
170void
171mbedtls_ecdsa_free (
172 mbedtls_ecdsa_context *ctx
173 )
174{
175 ASSERT (FALSE);
176}
177
178void
179mbedtls_ecdsa_restart_init (
180 mbedtls_ecdsa_restart_ctx *ctx
181 )
182{
183 ASSERT (FALSE);
184}
185
186void
187mbedtls_ecdsa_restart_free (
188 mbedtls_ecdsa_restart_ctx *ctx
189 )
190{
191 ASSERT (FALSE);
192}
193
194int
195mbedtls_ecp_point_write_binary (
196 const mbedtls_ecp_group *grp,
197 const mbedtls_ecp_point *P,
198 int format,
199 size_t *olen,
200 unsigned char *buf,
201 size_t buflen
202 )
203{
204 ASSERT (FALSE);
205 return -1;
206}
207
208int
209mbedtls_ecp_point_read_binary (
210 const mbedtls_ecp_group *grp,
211 mbedtls_ecp_point *P,
212 const unsigned char *buf,
213 size_t ilen
214 )
215{
216 ASSERT (FALSE);
217 return -1;
218}
219
220int
221mbedtls_ecp_write_key (
222 mbedtls_ecp_keypair *key,
223 unsigned char *buf,
224 size_t buflen
225 )
226{
227 ASSERT (FALSE);
228 return -1;
229}
230
231int
232mbedtls_ecp_group_load (
233 mbedtls_ecp_group *grp,
234 mbedtls_ecp_group_id id
235 )
236{
237 ASSERT (FALSE);
238 return -1;
239}
240
241int
242mbedtls_ecp_mul (
243 mbedtls_ecp_group *grp,
244 mbedtls_ecp_point *R,
245 const mbedtls_mpi *m,
246 const mbedtls_ecp_point *P,
247 int ( *f_rng )(void *, unsigned char *, size_t),
248 void *p_rng
249 )
250{
251 ASSERT (FALSE);
252 return -1;
253}
254
255int
256mbedtls_ecp_check_pubkey (
257 const mbedtls_ecp_group *grp,
258 const mbedtls_ecp_point *pt
259 )
260{
261 ASSERT (FALSE);
262 return -1;
263}
264
265int
266mbedtls_ecp_check_privkey (
267 const mbedtls_ecp_group *grp,
268 const mbedtls_mpi *d
269 )
270{
271 ASSERT (FALSE);
272 return -1;
273}
274
275int
276mbedtls_ecp_restart_is_enabled (
277 void
278 )
279{
280 ASSERT (FALSE);
281 return -1;
282}
283
284const mbedtls_ecp_curve_info *
285mbedtls_ecp_curve_info_from_tls_id (
286 uint16_t tls_id
287 )
288{
289 ASSERT (FALSE);
290 return (NULL);
291}
292
293int
294mbedtls_ecdh_setup (
295 mbedtls_ecdh_context *ctx,
296 mbedtls_ecp_group_id grp_id
297 )
298{
299 ASSERT (FALSE);
300 return -1;
301}
302
303int
304mbedtls_ecdh_make_params (
305 mbedtls_ecdh_context *ctx,
306 size_t *olen,
307 unsigned char *buf,
308 size_t blen,
309 int ( *f_rng )(void *, unsigned char *, size_t),
310 void *p_rng
311 )
312{
313 ASSERT (FALSE);
314 return -1;
315}
316
317int
318mbedtls_ecdh_get_params (
319 mbedtls_ecdh_context *ctx,
320 const mbedtls_ecp_keypair *key,
321 mbedtls_ecdh_side side
322 )
323{
324 ASSERT (FALSE);
325 return -1;
326}
327
328int
329mbedtls_ecdh_read_public (
330 mbedtls_ecdh_context *ctx,
331 const unsigned char *buf,
332 size_t blen
333 )
334{
335 ASSERT (FALSE);
336 return -1;
337}
338
339int
340mbedtls_ecdh_read_params (
341 mbedtls_ecdh_context *ctx,
342 const unsigned char **buf,
343 const unsigned char *end
344 )
345{
346 ASSERT (FALSE);
347 return -1;
348}
349
350int
351mbedtls_ecdh_make_public (
352 mbedtls_ecdh_context *ctx,
353 size_t *olen,
354 unsigned char *buf,
355 size_t blen,
356 int ( *f_rng )(void *, unsigned char *, size_t),
357 void *p_rng
358 )
359{
360 ASSERT (FALSE);
361 return -1;
362}
363
364void
365mbedtls_ecdh_enable_restart (
366 mbedtls_ecdh_context *ctx
367 )
368{
369 ASSERT (FALSE);
370}
371
372void
373mbedtls_ecp_point_init (
374 mbedtls_ecp_point *pt
375 )
376{
377 ASSERT (FALSE);
378}
379
380void
381mbedtls_ecp_group_init (
382 mbedtls_ecp_group *grp
383 )
384{
385 ASSERT (FALSE);
386}
387
388void
389mbedtls_ecp_point_free (
390 mbedtls_ecp_point *pt
391 )
392{
393 ASSERT (FALSE);
394}
395
396void
397mbedtls_ecp_group_free (
398 mbedtls_ecp_group *grp
399 )
400{
401 ASSERT (FALSE);
402}
403
404int
405mbedtls_ecp_is_zero (
406 mbedtls_ecp_point *pt
407 )
408{
409 ASSERT (FALSE);
410 return -1;
411}
412
413int
414mbedtls_ecp_point_cmp (
415 const mbedtls_ecp_point *P,
416 const mbedtls_ecp_point *Q
417 )
418{
419 ASSERT (FALSE);
420 return -1;
421}
422
423int
424mbedtls_ecp_muladd (
425 mbedtls_ecp_group *grp,
426 mbedtls_ecp_point *R,
427 const mbedtls_mpi *m,
428 const mbedtls_ecp_point *P,
429 const mbedtls_mpi *n,
430 const mbedtls_ecp_point *Q
431 )
432{
433 ASSERT (FALSE);
434 return -1;
435}
436
437int
438mbedtls_ecdh_gen_public (
439 mbedtls_ecp_group *grp,
440 mbedtls_mpi *d,
441 mbedtls_ecp_point *Q,
442 int ( *f_rng )(void *, unsigned char *, size_t),
443 void *p_rng
444 )
445{
446 ASSERT (FALSE);
447 return -1;
448}
449
450int
451mbedtls_ecdh_compute_shared (
452 mbedtls_ecp_group *grp,
453 mbedtls_mpi *z,
454 const mbedtls_ecp_point *Q,
455 const mbedtls_mpi *d,
456 int ( *f_rng )(void *, unsigned char *, size_t),
457 void *p_rng
458 )
459{
460 ASSERT (FALSE);
461 return -1;
462}
463
464int
465mbedtls_ecdsa_verify (
466 mbedtls_ecp_group *grp,
467 const unsigned char *buf,
468 size_t blen,
469 const mbedtls_ecp_point *Q,
470 const mbedtls_mpi *r,
471 const mbedtls_mpi *s
472 )
473{
474 ASSERT (FALSE);
475 return -1;
476}
477
478/*
479 * Compute ECDSA signature of a hashed message
480 */
481int
482mbedtls_ecdsa_sign (
483 mbedtls_ecp_group *grp,
484 mbedtls_mpi *r,
485 mbedtls_mpi *s,
486 const mbedtls_mpi *d,
487 const unsigned char *buf,
488 size_t blen,
489 int ( *f_rng )(void *, unsigned char *, size_t),
490 void *p_rng
491 )
492{
493 ASSERT (FALSE);
494 return -1;
495}
#define NULL
Definition: Base.h:319
#define FALSE
Definition: Base.h:307