diff options
author | tb <> | 2023-05-01 13:14:00 +0000 |
---|---|---|
committer | tb <> | 2023-05-01 13:14:00 +0000 |
commit | c1d7b783f4c335223baec00ed5d9de7f55c30a0a (patch) | |
tree | f13cae2b63759babebbb804edf0905a2817d32c7 | |
parent | f2fa8523cb2ce36a768f458ca1c0b5fe0f884fe4 (diff) | |
download | openbsd-c1d7b783f4c335223baec00ed5d9de7f55c30a0a.tar.gz openbsd-c1d7b783f4c335223baec00ed5d9de7f55c30a0a.tar.bz2 openbsd-c1d7b783f4c335223baec00ed5d9de7f55c30a0a.zip |
Convert EC_CURVE_DATA to C99 initializers
Also clean up the definition of EC_CURVE_DATA a bit.
ok jsing
-rw-r--r-- | src/lib/libcrypto/ec/ec_curve.c | 243 |
1 files changed, 192 insertions, 51 deletions
diff --git a/src/lib/libcrypto/ec/ec_curve.c b/src/lib/libcrypto/ec/ec_curve.c index 2179924666..f4d726b616 100644 --- a/src/lib/libcrypto/ec/ec_curve.c +++ b/src/lib/libcrypto/ec/ec_curve.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_curve.c,v 1.32 2023/05/01 12:39:38 tb Exp $ */ | 1 | /* $OpenBSD: ec_curve.c,v 1.33 2023/05/01 13:14:00 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -79,9 +79,9 @@ | |||
79 | #include "ec_local.h" | 79 | #include "ec_local.h" |
80 | 80 | ||
81 | typedef struct { | 81 | typedef struct { |
82 | int field_type, /* either NID_X9_62_prime_field or | 82 | int field_type; |
83 | * NID_X9_62_characteristic_two_field */ | 83 | int seed_len; |
84 | seed_len, param_len; | 84 | int param_len; |
85 | unsigned int cofactor; /* promoted to BN_ULONG */ | 85 | unsigned int cofactor; /* promoted to BN_ULONG */ |
86 | } EC_CURVE_DATA; | 86 | } EC_CURVE_DATA; |
87 | 87 | ||
@@ -92,7 +92,10 @@ static const struct { | |||
92 | } | 92 | } |
93 | _EC_NIST_PRIME_192 = { | 93 | _EC_NIST_PRIME_192 = { |
94 | { | 94 | { |
95 | NID_X9_62_prime_field, 20, 24, 1 | 95 | .field_type = NID_X9_62_prime_field, |
96 | .seed_len = 20, | ||
97 | .param_len = 24, | ||
98 | .cofactor = 1, | ||
96 | }, | 99 | }, |
97 | { | 100 | { |
98 | 0x30, 0x45, 0xAE, 0x6F, 0xC8, 0x42, 0x2F, 0x64, 0xED, 0x57, /* seed */ | 101 | 0x30, 0x45, 0xAE, 0x6F, 0xC8, 0x42, 0x2F, 0x64, 0xED, 0x57, /* seed */ |
@@ -125,7 +128,10 @@ static const struct { | |||
125 | } | 128 | } |
126 | _EC_NIST_PRIME_224 = { | 129 | _EC_NIST_PRIME_224 = { |
127 | { | 130 | { |
128 | NID_X9_62_prime_field, 20, 28, 1 | 131 | .field_type = NID_X9_62_prime_field, |
132 | .seed_len = 20, | ||
133 | .param_len = 28, | ||
134 | .cofactor = 1, | ||
129 | }, | 135 | }, |
130 | { | 136 | { |
131 | 0xBD, 0x71, 0x34, 0x47, 0x99, 0xD5, 0xC7, 0xFC, 0xDC, 0x45, /* seed */ | 137 | 0xBD, 0x71, 0x34, 0x47, 0x99, 0xD5, 0xC7, 0xFC, 0xDC, 0x45, /* seed */ |
@@ -158,7 +164,10 @@ static const struct { | |||
158 | } | 164 | } |
159 | _EC_NIST_PRIME_384 = { | 165 | _EC_NIST_PRIME_384 = { |
160 | { | 166 | { |
161 | NID_X9_62_prime_field, 20, 48, 1 | 167 | .field_type = NID_X9_62_prime_field, |
168 | .seed_len = 20, | ||
169 | .param_len = 48, | ||
170 | .cofactor = 1, | ||
162 | }, | 171 | }, |
163 | { | 172 | { |
164 | 0xA3, 0x35, 0x92, 0x6A, 0xA3, 0x19, 0xA2, 0x7A, 0x1D, 0x00, /* seed */ | 173 | 0xA3, 0x35, 0x92, 0x6A, 0xA3, 0x19, 0xA2, 0x7A, 0x1D, 0x00, /* seed */ |
@@ -203,7 +212,10 @@ static const struct { | |||
203 | } | 212 | } |
204 | _EC_NIST_PRIME_521 = { | 213 | _EC_NIST_PRIME_521 = { |
205 | { | 214 | { |
206 | NID_X9_62_prime_field, 20, 66, 1 | 215 | .field_type = NID_X9_62_prime_field, |
216 | .seed_len = 20, | ||
217 | .param_len = 66, | ||
218 | .cofactor = 1, | ||
207 | }, | 219 | }, |
208 | { | 220 | { |
209 | 0xD0, 0x9E, 0x88, 0x00, 0x29, 0x1C, 0xB8, 0x53, 0x96, 0xCC, /* seed */ | 221 | 0xD0, 0x9E, 0x88, 0x00, 0x29, 0x1C, 0xB8, 0x53, 0x96, 0xCC, /* seed */ |
@@ -261,7 +273,10 @@ static const struct { | |||
261 | } | 273 | } |
262 | _EC_X9_62_PRIME_192V2 = { | 274 | _EC_X9_62_PRIME_192V2 = { |
263 | { | 275 | { |
264 | NID_X9_62_prime_field, 20, 24, 1 | 276 | .field_type = NID_X9_62_prime_field, |
277 | .seed_len = 20, | ||
278 | .param_len = 24, | ||
279 | .cofactor = 1, | ||
265 | }, | 280 | }, |
266 | { | 281 | { |
267 | 0x31, 0xA9, 0x2E, 0xE2, 0x02, 0x9F, 0xD1, 0x0D, 0x90, 0x1B, /* seed */ | 282 | 0x31, 0xA9, 0x2E, 0xE2, 0x02, 0x9F, 0xD1, 0x0D, 0x90, 0x1B, /* seed */ |
@@ -294,7 +309,10 @@ static const struct { | |||
294 | } | 309 | } |
295 | _EC_X9_62_PRIME_192V3 = { | 310 | _EC_X9_62_PRIME_192V3 = { |
296 | { | 311 | { |
297 | NID_X9_62_prime_field, 20, 24, 1 | 312 | .field_type = NID_X9_62_prime_field, |
313 | .seed_len = 20, | ||
314 | .param_len = 24, | ||
315 | .cofactor = 1, | ||
298 | }, | 316 | }, |
299 | { | 317 | { |
300 | 0xC4, 0x69, 0x68, 0x44, 0x35, 0xDE, 0xB3, 0x78, 0xC4, 0xB6, /* seed */ | 318 | 0xC4, 0x69, 0x68, 0x44, 0x35, 0xDE, 0xB3, 0x78, 0xC4, 0xB6, /* seed */ |
@@ -327,7 +345,10 @@ static const struct { | |||
327 | } | 345 | } |
328 | _EC_X9_62_PRIME_239V1 = { | 346 | _EC_X9_62_PRIME_239V1 = { |
329 | { | 347 | { |
330 | NID_X9_62_prime_field, 20, 30, 1 | 348 | .field_type = NID_X9_62_prime_field, |
349 | .seed_len = 20, | ||
350 | .param_len = 30, | ||
351 | .cofactor = 1, | ||
331 | }, | 352 | }, |
332 | { | 353 | { |
333 | 0xE4, 0x3B, 0xB4, 0x60, 0xF0, 0xB8, 0x0C, 0xC0, 0xC0, 0xB0, /* seed */ | 354 | 0xE4, 0x3B, 0xB4, 0x60, 0xF0, 0xB8, 0x0C, 0xC0, 0xC0, 0xB0, /* seed */ |
@@ -365,7 +386,10 @@ static const struct { | |||
365 | } | 386 | } |
366 | _EC_X9_62_PRIME_239V2 = { | 387 | _EC_X9_62_PRIME_239V2 = { |
367 | { | 388 | { |
368 | NID_X9_62_prime_field, 20, 30, 1 | 389 | .field_type = NID_X9_62_prime_field, |
390 | .seed_len = 20, | ||
391 | .param_len = 30, | ||
392 | .cofactor = 1, | ||
369 | }, | 393 | }, |
370 | { | 394 | { |
371 | 0xE8, 0xB4, 0x01, 0x16, 0x04, 0x09, 0x53, 0x03, 0xCA, 0x3B, /* seed */ | 395 | 0xE8, 0xB4, 0x01, 0x16, 0x04, 0x09, 0x53, 0x03, 0xCA, 0x3B, /* seed */ |
@@ -403,7 +427,10 @@ static const struct { | |||
403 | } | 427 | } |
404 | _EC_X9_62_PRIME_239V3 = { | 428 | _EC_X9_62_PRIME_239V3 = { |
405 | { | 429 | { |
406 | NID_X9_62_prime_field, 20, 30, 1 | 430 | .field_type = NID_X9_62_prime_field, |
431 | .seed_len = 20, | ||
432 | .param_len = 30, | ||
433 | .cofactor = 1, | ||
407 | }, | 434 | }, |
408 | { | 435 | { |
409 | 0x7D, 0x73, 0x74, 0x16, 0x8F, 0xFE, 0x34, 0x71, 0xB6, 0x0A, /* seed */ | 436 | 0x7D, 0x73, 0x74, 0x16, 0x8F, 0xFE, 0x34, 0x71, 0xB6, 0x0A, /* seed */ |
@@ -442,7 +469,10 @@ static const struct { | |||
442 | } | 469 | } |
443 | _EC_X9_62_PRIME_256V1 = { | 470 | _EC_X9_62_PRIME_256V1 = { |
444 | { | 471 | { |
445 | NID_X9_62_prime_field, 20, 32, 1 | 472 | .field_type = NID_X9_62_prime_field, |
473 | .seed_len = 20, | ||
474 | .param_len = 32, | ||
475 | .cofactor = 1, | ||
446 | }, | 476 | }, |
447 | { | 477 | { |
448 | 0xC4, 0x9D, 0x36, 0x08, 0x86, 0xE7, 0x04, 0x93, 0x6A, 0x66, /* seed */ | 478 | 0xC4, 0x9D, 0x36, 0x08, 0x86, 0xE7, 0x04, 0x93, 0x6A, 0x66, /* seed */ |
@@ -482,7 +512,10 @@ static const struct { | |||
482 | } | 512 | } |
483 | _EC_SECG_PRIME_112R1 = { | 513 | _EC_SECG_PRIME_112R1 = { |
484 | { | 514 | { |
485 | NID_X9_62_prime_field, 20, 14, 1 | 515 | .field_type = NID_X9_62_prime_field, |
516 | .seed_len = 20, | ||
517 | .param_len = 14, | ||
518 | .cofactor = 1, | ||
486 | }, | 519 | }, |
487 | { | 520 | { |
488 | 0x00, 0xF5, 0x0B, 0x02, 0x8E, 0x4D, 0x69, 0x6E, 0x67, 0x68, /* seed */ | 521 | 0x00, 0xF5, 0x0B, 0x02, 0x8E, 0x4D, 0x69, 0x6E, 0x67, 0x68, /* seed */ |
@@ -509,7 +542,10 @@ static const struct { | |||
509 | } | 542 | } |
510 | _EC_SECG_PRIME_112R2 = { | 543 | _EC_SECG_PRIME_112R2 = { |
511 | { | 544 | { |
512 | NID_X9_62_prime_field, 20, 14, 4 | 545 | .field_type = NID_X9_62_prime_field, |
546 | .seed_len = 20, | ||
547 | .param_len = 14, | ||
548 | .cofactor = 4, | ||
513 | }, | 549 | }, |
514 | { | 550 | { |
515 | 0x00, 0x27, 0x57, 0xA1, 0x11, 0x4D, 0x69, 0x6E, 0x67, 0x68, /* seed */ | 551 | 0x00, 0x27, 0x57, 0xA1, 0x11, 0x4D, 0x69, 0x6E, 0x67, 0x68, /* seed */ |
@@ -536,7 +572,10 @@ static const struct { | |||
536 | } | 572 | } |
537 | _EC_SECG_PRIME_128R1 = { | 573 | _EC_SECG_PRIME_128R1 = { |
538 | { | 574 | { |
539 | NID_X9_62_prime_field, 20, 16, 1 | 575 | .field_type = NID_X9_62_prime_field, |
576 | .seed_len = 20, | ||
577 | .param_len = 16, | ||
578 | .cofactor = 1, | ||
540 | }, | 579 | }, |
541 | { | 580 | { |
542 | 0x00, 0x0E, 0x0D, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, /* seed */ | 581 | 0x00, 0x0E, 0x0D, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, /* seed */ |
@@ -563,7 +602,10 @@ static const struct { | |||
563 | } | 602 | } |
564 | _EC_SECG_PRIME_128R2 = { | 603 | _EC_SECG_PRIME_128R2 = { |
565 | { | 604 | { |
566 | NID_X9_62_prime_field, 20, 16, 4 | 605 | .field_type = NID_X9_62_prime_field, |
606 | .seed_len = 20, | ||
607 | .param_len = 16, | ||
608 | .cofactor = 4, | ||
567 | }, | 609 | }, |
568 | { | 610 | { |
569 | 0x00, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75, /* seed */ | 611 | 0x00, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75, /* seed */ |
@@ -590,7 +632,10 @@ static const struct { | |||
590 | } | 632 | } |
591 | _EC_SECG_PRIME_160K1 = { | 633 | _EC_SECG_PRIME_160K1 = { |
592 | { | 634 | { |
593 | NID_X9_62_prime_field, 0, 21, 1 | 635 | .field_type = NID_X9_62_prime_field, |
636 | .seed_len = 0, | ||
637 | .param_len = 21, | ||
638 | .cofactor = 1, | ||
594 | }, | 639 | }, |
595 | { /* no seed */ | 640 | { /* no seed */ |
596 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ | 641 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ |
@@ -620,7 +665,10 @@ static const struct { | |||
620 | } | 665 | } |
621 | _EC_SECG_PRIME_160R1 = { | 666 | _EC_SECG_PRIME_160R1 = { |
622 | { | 667 | { |
623 | NID_X9_62_prime_field, 20, 21, 1 | 668 | .field_type = NID_X9_62_prime_field, |
669 | .seed_len = 20, | ||
670 | .param_len = 21, | ||
671 | .cofactor = 1, | ||
624 | }, | 672 | }, |
625 | { | 673 | { |
626 | 0x10, 0x53, 0xCD, 0xE4, 0x2C, 0x14, 0xD6, 0x96, 0xE6, 0x76, /* seed */ | 674 | 0x10, 0x53, 0xCD, 0xE4, 0x2C, 0x14, 0xD6, 0x96, 0xE6, 0x76, /* seed */ |
@@ -653,7 +701,10 @@ static const struct { | |||
653 | } | 701 | } |
654 | _EC_SECG_PRIME_160R2 = { | 702 | _EC_SECG_PRIME_160R2 = { |
655 | { | 703 | { |
656 | NID_X9_62_prime_field, 20, 21, 1 | 704 | .field_type = NID_X9_62_prime_field, |
705 | .seed_len = 20, | ||
706 | .param_len = 21, | ||
707 | .cofactor = 1, | ||
657 | }, | 708 | }, |
658 | { | 709 | { |
659 | 0xB9, 0x9B, 0x99, 0xB0, 0x99, 0xB3, 0x23, 0xE0, 0x27, 0x09, /* seed */ | 710 | 0xB9, 0x9B, 0x99, 0xB0, 0x99, 0xB3, 0x23, 0xE0, 0x27, 0x09, /* seed */ |
@@ -686,7 +737,10 @@ static const struct { | |||
686 | } | 737 | } |
687 | _EC_SECG_PRIME_192K1 = { | 738 | _EC_SECG_PRIME_192K1 = { |
688 | { | 739 | { |
689 | NID_X9_62_prime_field, 0, 24, 1 | 740 | .field_type = NID_X9_62_prime_field, |
741 | .seed_len = 0, | ||
742 | .param_len = 24, | ||
743 | .cofactor = 1, | ||
690 | }, | 744 | }, |
691 | { /* no seed */ | 745 | { /* no seed */ |
692 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ | 746 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ |
@@ -716,7 +770,10 @@ static const struct { | |||
716 | } | 770 | } |
717 | _EC_SECG_PRIME_224K1 = { | 771 | _EC_SECG_PRIME_224K1 = { |
718 | { | 772 | { |
719 | NID_X9_62_prime_field, 0, 29, 1 | 773 | .field_type = NID_X9_62_prime_field, |
774 | .seed_len = 0, | ||
775 | .param_len = 29, | ||
776 | .cofactor = 1, | ||
720 | }, | 777 | }, |
721 | { /* no seed */ | 778 | { /* no seed */ |
722 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ | 779 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ |
@@ -746,7 +803,10 @@ static const struct { | |||
746 | } | 803 | } |
747 | _EC_SECG_PRIME_256K1 = { | 804 | _EC_SECG_PRIME_256K1 = { |
748 | { | 805 | { |
749 | NID_X9_62_prime_field, 0, 32, 1 | 806 | .field_type = NID_X9_62_prime_field, |
807 | .seed_len = 0, | ||
808 | .param_len = 32, | ||
809 | .cofactor = 1, | ||
750 | }, | 810 | }, |
751 | { /* no seed */ | 811 | { /* no seed */ |
752 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ | 812 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ |
@@ -783,7 +843,10 @@ static const struct { | |||
783 | } | 843 | } |
784 | _EC_WTLS_8 = { | 844 | _EC_WTLS_8 = { |
785 | { | 845 | { |
786 | NID_X9_62_prime_field, 0, 15, 1 | 846 | .field_type = NID_X9_62_prime_field, |
847 | .seed_len = 0, | ||
848 | .param_len = 15, | ||
849 | .cofactor = 1, | ||
787 | }, | 850 | }, |
788 | { /* no seed */ | 851 | { /* no seed */ |
789 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ | 852 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ |
@@ -807,7 +870,10 @@ static const struct { | |||
807 | } | 870 | } |
808 | _EC_WTLS_9 = { | 871 | _EC_WTLS_9 = { |
809 | { | 872 | { |
810 | NID_X9_62_prime_field, 0, 21, 1 | 873 | .field_type = NID_X9_62_prime_field, |
874 | .seed_len = 0, | ||
875 | .param_len = 21, | ||
876 | .cofactor = 1, | ||
811 | }, | 877 | }, |
812 | { /* no seed */ | 878 | { /* no seed */ |
813 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ | 879 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ |
@@ -837,7 +903,10 @@ static const struct { | |||
837 | } | 903 | } |
838 | _EC_WTLS_12 = { | 904 | _EC_WTLS_12 = { |
839 | { | 905 | { |
840 | NID_X9_62_prime_field, 0, 28, 1 | 906 | .field_type = NID_X9_62_prime_field, |
907 | .seed_len = 0, | ||
908 | .param_len = 28, | ||
909 | .cofactor = 1, | ||
841 | }, | 910 | }, |
842 | { /* no seed */ | 911 | { /* no seed */ |
843 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ | 912 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ |
@@ -875,7 +944,10 @@ static const struct { | |||
875 | } | 944 | } |
876 | _EC_brainpoolP160r1 = { | 945 | _EC_brainpoolP160r1 = { |
877 | { | 946 | { |
878 | NID_X9_62_prime_field, 0, 20, 1 | 947 | .field_type = NID_X9_62_prime_field, |
948 | .seed_len = 0, | ||
949 | .param_len = 20, | ||
950 | .cofactor = 1, | ||
879 | }, | 951 | }, |
880 | { /* no seed */ | 952 | { /* no seed */ |
881 | 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, /* p */ | 953 | 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, /* p */ |
@@ -899,7 +971,10 @@ static const struct { | |||
899 | } | 971 | } |
900 | _EC_brainpoolP160t1 = { | 972 | _EC_brainpoolP160t1 = { |
901 | { | 973 | { |
902 | NID_X9_62_prime_field, 0, 20, 1 | 974 | .field_type = NID_X9_62_prime_field, |
975 | .seed_len = 0, | ||
976 | .param_len = 20, | ||
977 | .cofactor = 1, | ||
903 | }, | 978 | }, |
904 | { /* no seed */ | 979 | { /* no seed */ |
905 | 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, /* p */ | 980 | 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, /* p */ |
@@ -923,7 +998,10 @@ static const struct { | |||
923 | } | 998 | } |
924 | _EC_brainpoolP192r1 = { | 999 | _EC_brainpoolP192r1 = { |
925 | { | 1000 | { |
926 | NID_X9_62_prime_field, 0, 24, 1 | 1001 | .field_type = NID_X9_62_prime_field, |
1002 | .seed_len = 0, | ||
1003 | .param_len = 24, | ||
1004 | .cofactor = 1, | ||
927 | }, | 1005 | }, |
928 | { /* no seed */ | 1006 | { /* no seed */ |
929 | 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, /* p */ | 1007 | 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, /* p */ |
@@ -953,7 +1031,10 @@ static const struct { | |||
953 | } | 1031 | } |
954 | _EC_brainpoolP192t1 = { | 1032 | _EC_brainpoolP192t1 = { |
955 | { | 1033 | { |
956 | NID_X9_62_prime_field, 0, 24, 1 | 1034 | .field_type = NID_X9_62_prime_field, |
1035 | .seed_len = 0, | ||
1036 | .param_len = 24, | ||
1037 | .cofactor = 1, | ||
957 | }, | 1038 | }, |
958 | { /* no seed */ | 1039 | { /* no seed */ |
959 | 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, /* p */ | 1040 | 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, /* p */ |
@@ -983,7 +1064,10 @@ static const struct { | |||
983 | } | 1064 | } |
984 | _EC_brainpoolP224r1 = { | 1065 | _EC_brainpoolP224r1 = { |
985 | { | 1066 | { |
986 | NID_X9_62_prime_field, 0, 28, 1 | 1067 | .field_type = NID_X9_62_prime_field, |
1068 | .seed_len = 0, | ||
1069 | .param_len = 28, | ||
1070 | .cofactor = 1, | ||
987 | }, | 1071 | }, |
988 | { /* no seed */ | 1072 | { /* no seed */ |
989 | 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, /* p */ | 1073 | 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, /* p */ |
@@ -1013,7 +1097,10 @@ static const struct { | |||
1013 | } | 1097 | } |
1014 | _EC_brainpoolP224t1 = { | 1098 | _EC_brainpoolP224t1 = { |
1015 | { | 1099 | { |
1016 | NID_X9_62_prime_field, 0, 28, 1 | 1100 | .field_type = NID_X9_62_prime_field, |
1101 | .seed_len = 0, | ||
1102 | .param_len = 28, | ||
1103 | .cofactor = 1, | ||
1017 | }, | 1104 | }, |
1018 | { /* no seed */ | 1105 | { /* no seed */ |
1019 | 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, /* p */ | 1106 | 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, /* p */ |
@@ -1043,7 +1130,10 @@ static const struct { | |||
1043 | } | 1130 | } |
1044 | _EC_brainpoolP256r1 = { | 1131 | _EC_brainpoolP256r1 = { |
1045 | { | 1132 | { |
1046 | NID_X9_62_prime_field, 0, 32, 1 | 1133 | .field_type = NID_X9_62_prime_field, |
1134 | .seed_len = 0, | ||
1135 | .param_len = 32, | ||
1136 | .cofactor = 1, | ||
1047 | }, | 1137 | }, |
1048 | { /* no seed */ | 1138 | { /* no seed */ |
1049 | 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, /* p */ | 1139 | 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, /* p */ |
@@ -1079,7 +1169,10 @@ static const struct { | |||
1079 | } | 1169 | } |
1080 | _EC_brainpoolP256t1 = { | 1170 | _EC_brainpoolP256t1 = { |
1081 | { | 1171 | { |
1082 | NID_X9_62_prime_field, 0, 32, 1 | 1172 | .field_type = NID_X9_62_prime_field, |
1173 | .seed_len = 0, | ||
1174 | .param_len = 32, | ||
1175 | .cofactor = 1, | ||
1083 | }, | 1176 | }, |
1084 | { /* no seed */ | 1177 | { /* no seed */ |
1085 | 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, /* p */ | 1178 | 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, /* p */ |
@@ -1115,7 +1208,10 @@ static const struct { | |||
1115 | } | 1208 | } |
1116 | _EC_brainpoolP320r1 = { | 1209 | _EC_brainpoolP320r1 = { |
1117 | { | 1210 | { |
1118 | NID_X9_62_prime_field, 0, 40, 1 | 1211 | .field_type = NID_X9_62_prime_field, |
1212 | .seed_len = 0, | ||
1213 | .param_len = 40, | ||
1214 | .cofactor = 1, | ||
1119 | }, | 1215 | }, |
1120 | { /* no seed */ | 1216 | { /* no seed */ |
1121 | 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, /* p */ | 1217 | 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, /* p */ |
@@ -1151,7 +1247,10 @@ static const struct { | |||
1151 | } | 1247 | } |
1152 | _EC_brainpoolP320t1 = { | 1248 | _EC_brainpoolP320t1 = { |
1153 | { | 1249 | { |
1154 | NID_X9_62_prime_field, 0, 40, 1 | 1250 | .field_type = NID_X9_62_prime_field, |
1251 | .seed_len = 0, | ||
1252 | .param_len = 40, | ||
1253 | .cofactor = 1, | ||
1155 | }, | 1254 | }, |
1156 | { /* no seed */ | 1255 | { /* no seed */ |
1157 | 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, /* p */ | 1256 | 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, /* p */ |
@@ -1187,7 +1286,10 @@ static const struct { | |||
1187 | } | 1286 | } |
1188 | _EC_brainpoolP384r1 = { | 1287 | _EC_brainpoolP384r1 = { |
1189 | { | 1288 | { |
1190 | NID_X9_62_prime_field, 0, 48, 1 | 1289 | .field_type = NID_X9_62_prime_field, |
1290 | .seed_len = 0, | ||
1291 | .param_len = 48, | ||
1292 | .cofactor = 1, | ||
1191 | }, | 1293 | }, |
1192 | { /* no seed */ | 1294 | { /* no seed */ |
1193 | 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, /* p */ | 1295 | 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, /* p */ |
@@ -1229,7 +1331,10 @@ static const struct { | |||
1229 | } | 1331 | } |
1230 | _EC_brainpoolP384t1 = { | 1332 | _EC_brainpoolP384t1 = { |
1231 | { | 1333 | { |
1232 | NID_X9_62_prime_field, 0, 48, 1 | 1334 | .field_type = NID_X9_62_prime_field, |
1335 | .seed_len = 0, | ||
1336 | .param_len = 48, | ||
1337 | .cofactor = 1, | ||
1233 | }, | 1338 | }, |
1234 | { /* no seed */ | 1339 | { /* no seed */ |
1235 | 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, /* p */ | 1340 | 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, /* p */ |
@@ -1271,7 +1376,10 @@ static const struct { | |||
1271 | } | 1376 | } |
1272 | _EC_brainpoolP512r1 = { | 1377 | _EC_brainpoolP512r1 = { |
1273 | { | 1378 | { |
1274 | NID_X9_62_prime_field, 0, 64, 1 | 1379 | .field_type = NID_X9_62_prime_field, |
1380 | .seed_len = 0, | ||
1381 | .param_len = 64, | ||
1382 | .cofactor = 1, | ||
1275 | }, | 1383 | }, |
1276 | { /* no seed */ | 1384 | { /* no seed */ |
1277 | 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, /* p */ | 1385 | 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, /* p */ |
@@ -1325,7 +1433,10 @@ static const struct { | |||
1325 | } | 1433 | } |
1326 | _EC_brainpoolP512t1 = { | 1434 | _EC_brainpoolP512t1 = { |
1327 | { | 1435 | { |
1328 | NID_X9_62_prime_field, 0, 64, 1 | 1436 | .field_type = NID_X9_62_prime_field, |
1437 | .seed_len = 0, | ||
1438 | .param_len = 64, | ||
1439 | .cofactor = 1, | ||
1329 | }, | 1440 | }, |
1330 | { /* no seed */ | 1441 | { /* no seed */ |
1331 | 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, /* p */ | 1442 | 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, /* p */ |
@@ -1379,7 +1490,10 @@ static const struct { | |||
1379 | } | 1490 | } |
1380 | _EC_FRP256v1 = { | 1491 | _EC_FRP256v1 = { |
1381 | { | 1492 | { |
1382 | NID_X9_62_prime_field, 0, 32, 1 | 1493 | .field_type = NID_X9_62_prime_field, |
1494 | .seed_len = 0, | ||
1495 | .param_len = 32, | ||
1496 | .cofactor = 1, | ||
1383 | }, | 1497 | }, |
1384 | { /* no seed */ | 1498 | { /* no seed */ |
1385 | 0xF1, 0xFD, 0x17, 0x8C, 0x0B, 0x3A, 0xD5, 0x8F, 0x10, 0x12, /* p */ | 1499 | 0xF1, 0xFD, 0x17, 0x8C, 0x0B, 0x3A, 0xD5, 0x8F, 0x10, 0x12, /* p */ |
@@ -1416,7 +1530,10 @@ static const struct { | |||
1416 | } | 1530 | } |
1417 | _EC_GOST_2001_Test = { | 1531 | _EC_GOST_2001_Test = { |
1418 | { | 1532 | { |
1419 | NID_X9_62_prime_field, 0, 32, 1 | 1533 | .field_type = NID_X9_62_prime_field, |
1534 | .seed_len = 0, | ||
1535 | .param_len = 32, | ||
1536 | .cofactor = 1, | ||
1420 | }, | 1537 | }, |
1421 | { /* no seed */ | 1538 | { /* no seed */ |
1422 | 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* p */ | 1539 | 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* p */ |
@@ -1452,7 +1569,10 @@ static const struct { | |||
1452 | } | 1569 | } |
1453 | _EC_GOST_2001_CryptoPro_A = { | 1570 | _EC_GOST_2001_CryptoPro_A = { |
1454 | { | 1571 | { |
1455 | NID_X9_62_prime_field, 0, 32, 1 | 1572 | .field_type = NID_X9_62_prime_field, |
1573 | .seed_len = 0, | ||
1574 | .param_len = 32, | ||
1575 | .cofactor = 1, | ||
1456 | }, | 1576 | }, |
1457 | { /* no seed */ | 1577 | { /* no seed */ |
1458 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ | 1578 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ |
@@ -1488,7 +1608,10 @@ static const struct { | |||
1488 | } | 1608 | } |
1489 | _EC_GOST_2001_CryptoPro_B = { | 1609 | _EC_GOST_2001_CryptoPro_B = { |
1490 | { | 1610 | { |
1491 | NID_X9_62_prime_field, 0, 32, 1 | 1611 | .field_type = NID_X9_62_prime_field, |
1612 | .seed_len = 0, | ||
1613 | .param_len = 32, | ||
1614 | .cofactor = 1, | ||
1492 | }, | 1615 | }, |
1493 | { /* no seed */ | 1616 | { /* no seed */ |
1494 | 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* p */ | 1617 | 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* p */ |
@@ -1524,7 +1647,10 @@ static const struct { | |||
1524 | } | 1647 | } |
1525 | _EC_GOST_2001_CryptoPro_C = { | 1648 | _EC_GOST_2001_CryptoPro_C = { |
1526 | { | 1649 | { |
1527 | NID_X9_62_prime_field, 0, 32, 1 | 1650 | .field_type = NID_X9_62_prime_field, |
1651 | .seed_len = 0, | ||
1652 | .param_len = 32, | ||
1653 | .cofactor = 1, | ||
1528 | }, | 1654 | }, |
1529 | { /* no seed */ | 1655 | { /* no seed */ |
1530 | 0x9B, 0x9F, 0x60, 0x5F, 0x5A, 0x85, 0x81, 0x07, 0xAB, 0x1E, /* p */ | 1656 | 0x9B, 0x9F, 0x60, 0x5F, 0x5A, 0x85, 0x81, 0x07, 0xAB, 0x1E, /* p */ |
@@ -1564,7 +1690,10 @@ static const struct { | |||
1564 | } | 1690 | } |
1565 | _EC_GOST_2012_256_TC26_A = { | 1691 | _EC_GOST_2012_256_TC26_A = { |
1566 | { | 1692 | { |
1567 | NID_X9_62_prime_field, 0, 32, 4 | 1693 | .field_type = NID_X9_62_prime_field, |
1694 | .seed_len = 0, | ||
1695 | .param_len = 32, | ||
1696 | .cofactor = 4, | ||
1568 | }, | 1697 | }, |
1569 | { /* no seed */ | 1698 | { /* no seed */ |
1570 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ | 1699 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */ |
@@ -1600,7 +1729,10 @@ static const struct { | |||
1600 | } | 1729 | } |
1601 | _EC_GOST_2012_512_Test = { | 1730 | _EC_GOST_2012_512_Test = { |
1602 | { | 1731 | { |
1603 | NID_X9_62_prime_field, 0, 64, 1 | 1732 | .field_type = NID_X9_62_prime_field, |
1733 | .seed_len = 0, | ||
1734 | .param_len = 64, | ||
1735 | .cofactor = 1, | ||
1604 | }, | 1736 | }, |
1605 | { /* no seed */ | 1737 | { /* no seed */ |
1606 | 0x45, 0x31, 0xac, 0xd1, 0xfe, 0x00, 0x23, 0xc7, 0x55, 0x0d, /* p */ | 1738 | 0x45, 0x31, 0xac, 0xd1, 0xfe, 0x00, 0x23, 0xc7, 0x55, 0x0d, /* p */ |
@@ -1654,7 +1786,10 @@ static const struct { | |||
1654 | } | 1786 | } |
1655 | _EC_GOST_2012_512_TC26_A = { | 1787 | _EC_GOST_2012_512_TC26_A = { |
1656 | { | 1788 | { |
1657 | NID_X9_62_prime_field, 0, 64, 1 | 1789 | .field_type = NID_X9_62_prime_field, |
1790 | .seed_len = 0, | ||
1791 | .param_len = 64, | ||
1792 | .cofactor = 1, | ||
1658 | }, | 1793 | }, |
1659 | { /* no seed */ | 1794 | { /* no seed */ |
1660 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* p */ | 1795 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* p */ |
@@ -1708,7 +1843,10 @@ static const struct { | |||
1708 | } | 1843 | } |
1709 | _EC_GOST_2012_512_TC26_B = { | 1844 | _EC_GOST_2012_512_TC26_B = { |
1710 | { | 1845 | { |
1711 | NID_X9_62_prime_field, 0, 64, 1 | 1846 | .field_type = NID_X9_62_prime_field, |
1847 | .seed_len = 0, | ||
1848 | .param_len = 64, | ||
1849 | .cofactor = 1, | ||
1712 | }, | 1850 | }, |
1713 | { /* no seed */ | 1851 | { /* no seed */ |
1714 | 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* p */ | 1852 | 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* p */ |
@@ -1766,7 +1904,10 @@ static const struct { | |||
1766 | } | 1904 | } |
1767 | _EC_GOST_2012_512_TC26_C = { | 1905 | _EC_GOST_2012_512_TC26_C = { |
1768 | { | 1906 | { |
1769 | NID_X9_62_prime_field, 0, 64, 4 | 1907 | .field_type = NID_X9_62_prime_field, |
1908 | .seed_len = 0, | ||
1909 | .param_len = 64, | ||
1910 | .cofactor = 4, | ||
1770 | }, | 1911 | }, |
1771 | { /* no seed */ | 1912 | { /* no seed */ |
1772 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* p */ | 1913 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* p */ |