Package list libcryptx-perl / a428ba7
ltc update Karel Miko 3 years ago
11 changed file(s) with 669 addition(s) and 445 deletion(s). Raw diff Collapse all Expand all
4141 ltc/math/rand_bn.o ltc/math/rand_prime.o ltc/math/tfm_desc.o ltc/math/fp/ltc_ecc_fp_mulmod.o \
4242 ltc/misc/adler32.o ltc/misc/burn_stack.o ltc/misc/compare_testvector.o ltc/misc/copy_or_zeromem.o \
4343 ltc/misc/crc32.o ltc/misc/error_to_string.o ltc/misc/mem_neq.o ltc/misc/pk_get_oid.o \
44 ltc/misc/zeromem.o ltc/misc/base16/base16_decode.o ltc/misc/base16/base16_encode.o \
44 ltc/misc/pk_oid_str.o ltc/misc/zeromem.o ltc/misc/base16/base16_decode.o ltc/misc/base16/base16_encode.o \
4545 ltc/misc/base32/base32_decode.o ltc/misc/base32/base32_encode.o ltc/misc/base64/base64_decode.o \
4646 ltc/misc/base64/base64_encode.o ltc/misc/crypt/crypt.o ltc/misc/crypt/crypt_argchk.o \
4747 ltc/misc/crypt/crypt_cipher_descriptor.o ltc/misc/crypt/crypt_cipher_is_valid.o ltc/misc/crypt/crypt_constants.o \
101101 ltc/pk/dsa/dsa_set_pqg_dsaparam.o ltc/pk/dsa/dsa_shared_secret.o ltc/pk/dsa/dsa_sign_hash.o \
102102 ltc/pk/dsa/dsa_verify_hash.o ltc/pk/dsa/dsa_verify_key.o ltc/pk/ecc/ecc.o ltc/pk/ecc/ecc_ansi_x963_export.o \
103103 ltc/pk/ecc/ecc_ansi_x963_import.o ltc/pk/ecc/ecc_decrypt_key.o ltc/pk/ecc/ecc_encrypt_key.o \
104 ltc/pk/ecc/ecc_export.o ltc/pk/ecc/ecc_export_openssl.o ltc/pk/ecc/ecc_free.o ltc/pk/ecc/ecc_get_curve_by_name.o \
104 ltc/pk/ecc/ecc_export.o ltc/pk/ecc/ecc_export_openssl.o ltc/pk/ecc/ecc_free.o ltc/pk/ecc/ecc_get_curve.o \
105105 ltc/pk/ecc/ecc_get_key.o ltc/pk/ecc/ecc_get_size.o ltc/pk/ecc/ecc_import.o ltc/pk/ecc/ecc_import_openssl.o \
106106 ltc/pk/ecc/ecc_import_pkcs8.o ltc/pk/ecc/ecc_import_x509.o ltc/pk/ecc/ecc_make_key.o \
107107 ltc/pk/ecc/ecc_set_dp.o ltc/pk/ecc/ecc_set_dp_internal.o ltc/pk/ecc/ecc_set_key.o \
4444 ltc/math/rand_bn.obj ltc/math/rand_prime.obj ltc/math/tfm_desc.obj ltc/math/fp/ltc_ecc_fp_mulmod.obj \
4545 ltc/misc/adler32.obj ltc/misc/burn_stack.obj ltc/misc/compare_testvector.obj ltc/misc/copy_or_zeromem.obj \
4646 ltc/misc/crc32.obj ltc/misc/error_to_string.obj ltc/misc/mem_neq.obj ltc/misc/pk_get_oid.obj \
47 ltc/misc/zeromem.obj ltc/misc/base16/base16_decode.obj ltc/misc/base16/base16_encode.obj \
47 ltc/misc/pk_oid_str.obj ltc/misc/zeromem.obj ltc/misc/base16/base16_decode.obj ltc/misc/base16/base16_encode.obj \
4848 ltc/misc/base32/base32_decode.obj ltc/misc/base32/base32_encode.obj ltc/misc/base64/base64_decode.obj \
4949 ltc/misc/base64/base64_encode.obj ltc/misc/crypt/crypt.obj ltc/misc/crypt/crypt_argchk.obj \
5050 ltc/misc/crypt/crypt_cipher_descriptor.obj ltc/misc/crypt/crypt_cipher_is_valid.obj \
109109 ltc/pk/dsa/dsa_verify_key.obj ltc/pk/ecc/ecc.obj ltc/pk/ecc/ecc_ansi_x963_export.obj \
110110 ltc/pk/ecc/ecc_ansi_x963_import.obj ltc/pk/ecc/ecc_decrypt_key.obj ltc/pk/ecc/ecc_encrypt_key.obj \
111111 ltc/pk/ecc/ecc_export.obj ltc/pk/ecc/ecc_export_openssl.obj ltc/pk/ecc/ecc_free.obj \
112 ltc/pk/ecc/ecc_get_curve_by_name.obj ltc/pk/ecc/ecc_get_key.obj ltc/pk/ecc/ecc_get_size.obj \
112 ltc/pk/ecc/ecc_get_curve.obj ltc/pk/ecc/ecc_get_key.obj ltc/pk/ecc/ecc_get_size.obj \
113113 ltc/pk/ecc/ecc_import.obj ltc/pk/ecc/ecc_import_openssl.obj ltc/pk/ecc/ecc_import_pkcs8.obj \
114114 ltc/pk/ecc/ecc_import_x509.obj ltc/pk/ecc/ecc_make_key.obj ltc/pk/ecc/ecc_set_dp.obj \
115115 ltc/pk/ecc/ecc_set_dp_internal.obj ltc/pk/ecc/ecc_set_key.obj ltc/pk/ecc/ecc_shared_secret.obj \
4343 } oid_st;
4444
4545 int pk_get_oid(int pk, oid_st *st);
46 int pk_oid_str_to_num(const char *OID, unsigned long *oid, unsigned long *oidlen);
47 int pk_oid_num_to_str(unsigned long *oid, unsigned long oidlen, char *OID, unsigned long *outlen);
4648 #endif /* LTC_SOURCE */
4749
4850 /* ---- RSA ---- */
257259
258260 /** Structure defines a GF(p) curve */
259261 typedef struct {
260 /** name of curve */
261 const char *names[6];
262
263262 /** The prime that defines the field the curve is in (encoded in hex) */
264263 const char *prime;
265264
282281 unsigned long cofactor;
283282
284283 /** The OID */
285 unsigned long oid[16];
286 unsigned long oidlen;
284 const char *OID;
287285 } ltc_ecc_curve;
288286
289287 /** A point on a ECC curve, stored in Jacbobian format such that (x,y,z) => (x/z^2, y/z^3, 1) when interpretted as affine */
341339 void ecc_sizes(int *low, int *high);
342340 int ecc_get_size(ecc_key *key);
343341
344 int ecc_get_curve_by_name(const char* name, const ltc_ecc_curve** cu);
342 int ecc_get_curve(const char* name_or_oid, const ltc_ecc_curve** cu);
345343 int ecc_set_dp(const ltc_ecc_curve *cu, ecc_key *key);
346344 int ecc_generate_key(prng_state *prng, int wprng, ecc_key *key);
347345 int ecc_set_key(const unsigned char *in, unsigned long inlen, int type, ecc_key *key);
397395 /* INTERNAL ONLY - it should be later moved to src/headers/tomcrypt_internal.h */
398396
399397 int ecc_set_dp_from_mpis(void *a, void *b, void *prime, void *order, void *gx, void *gy, unsigned long cofactor, ecc_key *key);
400 int ecc_set_dp_by_oid(unsigned long *oid, unsigned long oidsize, ecc_key *key);
401398 int ecc_copy_dp(const ecc_key *srckey, ecc_key *key);
402399 int ecc_set_dp_by_size(int size, ecc_key *key);
403400
0 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
1 *
2 * LibTomCrypt is a library that provides various cryptographic
3 * algorithms in a highly modular and flexible manner.
4 *
5 * The library is free for all purposes without any express
6 * guarantee it works.
7 */
8
9 #include "tomcrypt.h"
10
11 int pk_oid_str_to_num(const char *OID, unsigned long *oid, unsigned long *oidlen)
12 {
13 unsigned long i, j, limit;
14
15 LTC_ARGCHK(oid != NULL);
16 LTC_ARGCHK(oidlen != NULL);
17
18 limit = *oidlen;
19 *oidlen = 0; /* make sure that we return zero oidlen on error */
20 for (i = 0; i < limit; i++) oid[i] = 0;
21
22 if ((OID == NULL) || (strlen(OID) == 0)) return CRYPT_OK;
23
24 for (i = 0, j = 0; i < strlen(OID); i++) {
25 if (OID[i] == '.') {
26 if (++j >= limit) return CRYPT_ERROR;
27 }
28 else if ((OID[i] >= '0') && (OID[i] <= '9')) {
29 oid[j] = oid[j] * 10 + (OID[i] - '0');
30 }
31 else {
32 return CRYPT_ERROR;
33 }
34 }
35 if (j == 0) return CRYPT_ERROR;
36 *oidlen = j + 1;
37 return CRYPT_OK;
38 }
39
40 int pk_oid_num_to_str(unsigned long *oid, unsigned long oidlen, char *OID, unsigned long *outlen)
41 {
42 int i;
43 unsigned long j, k;
44 char tmp[256] = { 0 };
45 unsigned long tmpsz = sizeof(tmp);
46
47 LTC_ARGCHK(oid != NULL);
48 LTC_ARGCHK(OID != NULL);
49 LTC_ARGCHK(outlen != NULL);
50
51 for (i = oidlen - 1, k = 0; i >= 0; i--) {
52 j = oid[i];
53 if (j == 0) {
54 tmp[k] = '0';
55 if (++k >= tmpsz) return CRYPT_ERROR;
56 }
57 else {
58 while (j > 0) {
59 tmp[k] = '0' + (j % 10);
60 if (++k >= tmpsz) return CRYPT_ERROR;
61 j /= 10;
62 }
63 }
64 if (i > 0) {
65 tmp[k] = '.';
66 if (++k >= tmpsz) return CRYPT_ERROR;
67 }
68 }
69 if (*outlen < k + 1) {
70 *outlen = k + 1;
71 return CRYPT_BUFFER_OVERFLOW;
72 }
73 for (j = 0; j < k; j++) OID[j] = tmp[k - j - 1];
74 OID[k] = '\0';
75 *outlen = k; /* the length without terminating NUL byte */
76 return CRYPT_OK;
77 }
78
79 /* ref: $Format:%D$ */
80 /* git commit: $Format:%H$ */
81 /* commit time: $Format:%ai$ */
2525 const ltc_ecc_curve ltc_ecc_curves[] = {
2626 #if defined(LTC_ECC_SECP112R1) || defined(LTC_ECC112)
2727 {
28 /* curve name */ { "SECP112R1", "ECC-112", NULL },
29 /* prime */ "DB7C2ABF62E35E668076BEAD208B",
30 /* A */ "DB7C2ABF62E35E668076BEAD2088",
31 /* B */ "659EF8BA043916EEDE8911702B22",
32 /* order */ "DB7C2ABF62E35E7628DFAC6561C5",
33 /* Gx */ "09487239995A5EE76B55F9C2F098",
34 /* Gy */ "A89CE5AF8724C0A23E0E0FF77500",
35 /* cofactor */ 1,
36 /* OID */ { 1,3,132,0,6 }, 5
28 /* prime */ "DB7C2ABF62E35E668076BEAD208B",
29 /* A */ "DB7C2ABF62E35E668076BEAD2088",
30 /* B */ "659EF8BA043916EEDE8911702B22",
31 /* order */ "DB7C2ABF62E35E7628DFAC6561C5",
32 /* Gx */ "09487239995A5EE76B55F9C2F098",
33 /* Gy */ "A89CE5AF8724C0A23E0E0FF77500",
34 /* cofactor */ 1,
35 /* OID */ "1.3.132.0.6"
3736 },
3837 #endif
3938 #ifdef LTC_ECC_SECP112R2
4039 {
41 /* curve name */ { "SECP112R2", NULL },
42 /* prime */ "DB7C2ABF62E35E668076BEAD208B",
43 /* A */ "6127C24C05F38A0AAAF65C0EF02C",
44 /* B */ "51DEF1815DB5ED74FCC34C85D709",
45 /* order */ "36DF0AAFD8B8D7597CA10520D04B",
46 /* Gx */ "4BA30AB5E892B4E1649DD0928643",
47 /* Gy */ "ADCD46F5882E3747DEF36E956E97",
48 /* cofactor */ 4,
49 /* OID */ { 1,3,132,0,7 }, 5
40 /* prime */ "DB7C2ABF62E35E668076BEAD208B",
41 /* A */ "6127C24C05F38A0AAAF65C0EF02C",
42 /* B */ "51DEF1815DB5ED74FCC34C85D709",
43 /* order */ "36DF0AAFD8B8D7597CA10520D04B",
44 /* Gx */ "4BA30AB5E892B4E1649DD0928643",
45 /* Gy */ "ADCD46F5882E3747DEF36E956E97",
46 /* cofactor */ 4,
47 /* OID */ "1.3.132.0.7"
5048 },
5149 #endif
5250 #if defined(LTC_ECC_SECP128R1) || defined(LTC_ECC128)
5351 {
54 /* curve name */ { "SECP128R1", "ECC-128", NULL },
55 /* prime */ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF",
56 /* A */ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC",
57 /* B */ "E87579C11079F43DD824993C2CEE5ED3",
58 /* order */ "FFFFFFFE0000000075A30D1B9038A115",
59 /* Gx */ "161FF7528B899B2D0C28607CA52C5B86",
60 /* Gy */ "CF5AC8395BAFEB13C02DA292DDED7A83",
61 /* cofactor */ 1,
62 /* OID */ { 1,3,132,0,28 }, 5
52 /* prime */ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF",
53 /* A */ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC",
54 /* B */ "E87579C11079F43DD824993C2CEE5ED3",
55 /* order */ "FFFFFFFE0000000075A30D1B9038A115",
56 /* Gx */ "161FF7528B899B2D0C28607CA52C5B86",
57 /* Gy */ "CF5AC8395BAFEB13C02DA292DDED7A83",
58 /* cofactor */ 1,
59 /* OID */ "1.3.132.0.28"
6360 },
6461 #endif
6562 #ifdef LTC_ECC_SECP128R2
6663 {
67 /* curve name */ { "SECP128R2", NULL },
68 /* prime */ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF",
69 /* A */ "D6031998D1B3BBFEBF59CC9BBFF9AEE1",
70 /* B */ "5EEEFCA380D02919DC2C6558BB6D8A5D",
71 /* order */ "3FFFFFFF7FFFFFFFBE0024720613B5A3",
72 /* Gx */ "7B6AA5D85E572983E6FB32A7CDEBC140",
73 /* Gy */ "27B6916A894D3AEE7106FE805FC34B44",
74 /* cofactor */ 4,
75 /* OID */ { 1,3,132,0,29 }, 5
64 /* prime */ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF",
65 /* A */ "D6031998D1B3BBFEBF59CC9BBFF9AEE1",
66 /* B */ "5EEEFCA380D02919DC2C6558BB6D8A5D",
67 /* order */ "3FFFFFFF7FFFFFFFBE0024720613B5A3",
68 /* Gx */ "7B6AA5D85E572983E6FB32A7CDEBC140",
69 /* Gy */ "27B6916A894D3AEE7106FE805FC34B44",
70 /* cofactor */ 4,
71 /* OID */ "1.3.132.0.29"
7672 },
7773 #endif
7874 #if defined(LTC_ECC_SECP160R1) || defined(LTC_ECC160)
7975 {
80 /* curve name */ { "SECP160R1", "ECC-160", NULL },
81 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF",
82 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC",
83 /* B */ "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45",
84 /* order */ "0100000000000000000001F4C8F927AED3CA752257",
85 /* Gx */ "4A96B5688EF573284664698968C38BB913CBFC82",
86 /* Gy */ "23A628553168947D59DCC912042351377AC5FB32",
87 /* cofactor */ 1,
88 /* OID */ { 1,3,132,0,8 }, 5
76 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF",
77 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC",
78 /* B */ "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45",
79 /* order */ "0100000000000000000001F4C8F927AED3CA752257",
80 /* Gx */ "4A96B5688EF573284664698968C38BB913CBFC82",
81 /* Gy */ "23A628553168947D59DCC912042351377AC5FB32",
82 /* cofactor */ 1,
83 /* OID */ "1.3.132.0.8"
8984 },
9085 #endif
9186 #ifdef LTC_ECC_SECP160R2
9287 {
93 /* curve name */ { "SECP160R2", NULL },
94 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73",
95 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70",
96 /* B */ "B4E134D3FB59EB8BAB57274904664D5AF50388BA",
97 /* order */ "0100000000000000000000351EE786A818F3A1A16B",
98 /* Gx */ "52DCB034293A117E1F4FF11B30F7199D3144CE6D",
99 /* Gy */ "FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E",
100 /* cofactor */ 1,
101 /* OID */ { 1,3,132,0,30 }, 5
88 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73",
89 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70",
90 /* B */ "B4E134D3FB59EB8BAB57274904664D5AF50388BA",
91 /* order */ "0100000000000000000000351EE786A818F3A1A16B",
92 /* Gx */ "52DCB034293A117E1F4FF11B30F7199D3144CE6D",
93 /* Gy */ "FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E",
94 /* cofactor */ 1,
95 /* OID */ "1.3.132.0.30"
10296 },
10397 #endif
10498 #ifdef LTC_ECC_SECP160K1
10599 {
106 /* curve name */ { "SECP160K1", NULL },
107 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73",
108 /* A */ "0000000000000000000000000000000000000000",
109 /* B */ "0000000000000000000000000000000000000007",
110 /* order */ "0100000000000000000001B8FA16DFAB9ACA16B6B3",
111 /* Gx */ "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB",
112 /* Gy */ "938CF935318FDCED6BC28286531733C3F03C4FEE",
113 /* cofactor */ 1,
114 /* OID */ { 1,3,132,0,9 }, 5
100 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73",
101 /* A */ "0000000000000000000000000000000000000000",
102 /* B */ "0000000000000000000000000000000000000007",
103 /* order */ "0100000000000000000001B8FA16DFAB9ACA16B6B3",
104 /* Gx */ "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB",
105 /* Gy */ "938CF935318FDCED6BC28286531733C3F03C4FEE",
106 /* cofactor */ 1,
107 /* OID */ "1.3.132.0.9"
115108 },
116109 #endif
117110 #if defined(LTC_ECC_SECP192R1) || defined(LTC_ECC192)
118111 {
119 /* curve name */ { "SECP192R1", "NISTP192", "PRIME192V1", "ECC-192", "P-192", NULL },
120 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
121 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",
122 /* B */ "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1",
123 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831",
124 /* Gx */ "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012",
125 /* Gy */ "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",
126 /* cofactor */ 1,
127 /* OID */ { 1,2,840,10045,3,1,1 }, 7
112 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
113 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",
114 /* B */ "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1",
115 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831",
116 /* Gx */ "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012",
117 /* Gy */ "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",
118 /* cofactor */ 1,
119 /* OID */ "1.2.840.10045.3.1.1"
128120 },
129121 #endif
130122 #ifdef LTC_ECC_PRIME192V2
131123 {
132 /* curve name */ { "PRIME192V2", NULL },
133 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
134 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",
135 /* B */ "CC22D6DFB95C6B25E49C0D6364A4E5980C393AA21668D953",
136 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFE5FB1A724DC80418648D8DD31",
137 /* Gx */ "EEA2BAE7E1497842F2DE7769CFE9C989C072AD696F48034A",
138 /* Gy */ "6574D11D69B6EC7A672BB82A083DF2F2B0847DE970B2DE15",
139 /* cofactor */ 1,
140 /* OID */ { 1,2,840,10045,3,1,2 }, 7
124 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
125 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",
126 /* B */ "CC22D6DFB95C6B25E49C0D6364A4E5980C393AA21668D953",
127 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFE5FB1A724DC80418648D8DD31",
128 /* Gx */ "EEA2BAE7E1497842F2DE7769CFE9C989C072AD696F48034A",
129 /* Gy */ "6574D11D69B6EC7A672BB82A083DF2F2B0847DE970B2DE15",
130 /* cofactor */ 1,
131 /* OID */ "1.2.840.10045.3.1.2"
141132 },
142133 #endif
143134 #ifdef LTC_ECC_PRIME192V3
144135 {
145 /* curve name */ { "PRIME192V3", NULL },
146 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
147 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",
148 /* B */ "22123DC2395A05CAA7423DAECCC94760A7D462256BD56916",
149 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFF7A62D031C83F4294F640EC13",
150 /* Gx */ "7D29778100C65A1DA1783716588DCE2B8B4AEE8E228F1896",
151 /* Gy */ "38A90F22637337334B49DCB66A6DC8F9978ACA7648A943B0",
152 /* cofactor */ 1,
153 /* OID */ { 1,2,840,10045,3,1,3 }, 7
136 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
137 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",
138 /* B */ "22123DC2395A05CAA7423DAECCC94760A7D462256BD56916",
139 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFF7A62D031C83F4294F640EC13",
140 /* Gx */ "7D29778100C65A1DA1783716588DCE2B8B4AEE8E228F1896",
141 /* Gy */ "38A90F22637337334B49DCB66A6DC8F9978ACA7648A943B0",
142 /* cofactor */ 1,
143 /* OID */ "1.2.840.10045.3.1.3"
154144 },
155145 #endif
156146 #ifdef LTC_ECC_SECP192K1
157147 {
158 /* curve name */ { "SECP192K1", NULL },
159 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37",
160 /* A */ "000000000000000000000000000000000000000000000000",
161 /* B */ "000000000000000000000000000000000000000000000003",
162 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D",
163 /* Gx */ "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D",
164 /* Gy */ "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",
165 /* cofactor */ 1,
166 /* OID */ { 1,3,132,0,31 }, 5
148 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37",
149 /* A */ "000000000000000000000000000000000000000000000000",
150 /* B */ "000000000000000000000000000000000000000000000003",
151 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D",
152 /* Gx */ "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D",
153 /* Gy */ "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",
154 /* cofactor */ 1,
155 /* OID */ "1.3.132.0.31"
167156 },
168157 #endif
169158 #if defined(LTC_ECC_SECP224R1) || defined(LTC_ECC224)
170159 {
171 /* curve name */ { "SECP224R1", "NISTP224", "ECC-224", "P-224", NULL },
172 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001",
173 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE",
174 /* B */ "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4",
175 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D",
176 /* Gx */ "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21",
177 /* Gy */ "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",
178 /* cofactor */ 1,
179 /* OID */ { 1,3,132,0,33 }, 5
160 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001",
161 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE",
162 /* B */ "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4",
163 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D",
164 /* Gx */ "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21",
165 /* Gy */ "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",
166 /* cofactor */ 1,
167 /* OID */ "1.3.132.0.33"
180168 },
181169 #endif
182170 #ifdef LTC_ECC_SECP224K1
183171 {
184 /* curve name */ { "SECP224K1", NULL },
185 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D",
186 /* A */ "00000000000000000000000000000000000000000000000000000000",
187 /* B */ "00000000000000000000000000000000000000000000000000000005",
188 /* order */ "010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7",
189 /* Gx */ "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C",
190 /* Gy */ "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5",
191 /* cofactor */ 1,
192 /* OID */ { 1,3,132,0,32 }, 5
172 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D",
173 /* A */ "00000000000000000000000000000000000000000000000000000000",
174 /* B */ "00000000000000000000000000000000000000000000000000000005",
175 /* order */ "010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7",
176 /* Gx */ "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C",
177 /* Gy */ "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5",
178 /* cofactor */ 1,
179 /* OID */ "1.3.132.0.32"
193180 },
194181 #endif
195182 #if defined(LTC_ECC_SECP256R1) || defined(LTC_ECC256)
196183 {
197 /* curve name */ { "SECP256R1", "NISTP256", "PRIME256V1", "ECC-256", "P-256", NULL },
198 /* prime */ "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",
199 /* A */ "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",
200 /* B */ "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",
201 /* order */ "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551",
202 /* Gx */ "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",
203 /* Gy */ "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",
204 /* cofactor */ 1,
205 /* OID */ { 1,2,840,10045,3,1,7 }, 7
184 /* prime */ "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",
185 /* A */ "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",
186 /* B */ "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",
187 /* order */ "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551",
188 /* Gx */ "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",
189 /* Gy */ "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",
190 /* cofactor */ 1,
191 /* OID */ "1.2.840.10045.3.1.7"
206192 },
207193 #endif
208194 #ifdef LTC_ECC_SECP256K1
209195 {
210 /* curve name */ { "SECP256K1", NULL },
211 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F",
212 /* A */ "0000000000000000000000000000000000000000000000000000000000000000",
213 /* B */ "0000000000000000000000000000000000000000000000000000000000000007",
214 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",
215 /* Gx */ "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",
216 /* Gy */ "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",
217 /* cofactor */ 1,
218 /* OID */ { 1,3,132,0,10 }, 5
196 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F",
197 /* A */ "0000000000000000000000000000000000000000000000000000000000000000",
198 /* B */ "0000000000000000000000000000000000000000000000000000000000000007",
199 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",
200 /* Gx */ "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",
201 /* Gy */ "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",
202 /* cofactor */ 1,
203 /* OID */ "1.3.132.0.10"
219204 },
220205 #endif
221206 #if defined(LTC_ECC_SECP384R1) || defined(LTC_ECC384)
222207 {
223 /* curve name */ { "SECP384R1", "NISTP384", "ECC-384", "P-384", NULL },
224 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF",
225 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC",
226 /* B */ "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF",
227 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973",
228 /* Gx */ "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7",
229 /* Gy */ "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F",
230 /* cofactor */ 1,
231 /* OID */ { 1,3,132,0,34 }, 5
208 /* prime */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF",
209 /* A */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC",
210 /* B */ "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF",
211 /* order */ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973",
212 /* Gx */ "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7",
213 /* Gy */ "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F",
214 /* cofactor */ 1,
215 /* OID */ "1.3.132.0.34"
232216 },
233217 #endif
234218 #if defined(LTC_ECC_SECP521R1) || defined(LTC_ECC521)
235219 {
236 /* curve name */ { "SECP521R1", "NISTP521", "ECC-521", "P-521", NULL },
237 /* prime */ "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
238 /* A */ "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC",
239 /* B */ "0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00",
240 /* order */ "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409",
241 /* Gx */ "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66",
242 /* Gy */ "011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650",
243 /* cofactor */ 1,
244 /* OID */ { 1,3,132,0,35 }, 5
220 /* prime */ "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
221 /* A */ "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC",
222 /* B */ "0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00",
223 /* order */ "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409",
224 /* Gx */ "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66",
225 /* Gy */ "011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650",
226 /* cofactor */ 1,
227 /* OID */ "1.3.132.0.35"
245228 },
246229 #endif
247230 #ifdef LTC_ECC_PRIME239V1
248231 {
249 /* curve name */ { "PRIME239V1", NULL },
250 /* prime */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",
251 /* A */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",
252 /* B */ "6B016C3BDCF18941D0D654921475CA71A9DB2FB27D1D37796185C2942C0A",
253 /* order */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF9E5E9A9F5D9071FBD1522688909D0B",
254 /* Gx */ "0FFA963CDCA8816CCC33B8642BEDF905C3D358573D3F27FBBD3B3CB9AAAF",
255 /* Gy */ "7DEBE8E4E90A5DAE6E4054CA530BA04654B36818CE226B39FCCB7B02F1AE",
256 /* cofactor */ 1,
257 /* OID */ { 1,2,840,10045,3,1,4 }, 7
232 /* prime */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",
233 /* A */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",
234 /* B */ "6B016C3BDCF18941D0D654921475CA71A9DB2FB27D1D37796185C2942C0A",
235 /* order */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF9E5E9A9F5D9071FBD1522688909D0B",
236 /* Gx */ "0FFA963CDCA8816CCC33B8642BEDF905C3D358573D3F27FBBD3B3CB9AAAF",
237 /* Gy */ "7DEBE8E4E90A5DAE6E4054CA530BA04654B36818CE226B39FCCB7B02F1AE",
238 /* cofactor */ 1,
239 /* OID */ "1.2.840.10045.3.1.4"
258240 },
259241 #endif
260242 #ifdef LTC_ECC_PRIME239V2
261243 {
262 /* curve name */ { "PRIME239V2", NULL },
263 /* prime */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",
264 /* A */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",
265 /* B */ "617FAB6832576CBBFED50D99F0249C3FEE58B94BA0038C7AE84C8C832F2C",
266 /* order */ "7FFFFFFFFFFFFFFFFFFFFFFF800000CFA7E8594377D414C03821BC582063",
267 /* Gx */ "38AF09D98727705120C921BB5E9E26296A3CDCF2F35757A0EAFD87B830E7",
268 /* Gy */ "5B0125E4DBEA0EC7206DA0FC01D9B081329FB555DE6EF460237DFF8BE4BA",
269 /* cofactor */ 1,
270 /* OID */ { 1,2,840,10045,3,1,5 }, 7
244 /* prime */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",
245 /* A */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",
246 /* B */ "617FAB6832576CBBFED50D99F0249C3FEE58B94BA0038C7AE84C8C832F2C",
247 /* order */ "7FFFFFFFFFFFFFFFFFFFFFFF800000CFA7E8594377D414C03821BC582063",
248 /* Gx */ "38AF09D98727705120C921BB5E9E26296A3CDCF2F35757A0EAFD87B830E7",
249 /* Gy */ "5B0125E4DBEA0EC7206DA0FC01D9B081329FB555DE6EF460237DFF8BE4BA",
250 /* cofactor */ 1,
251 /* OID */ "1.2.840.10045.3.1.5"
271252 },
272253 #endif
273254 #ifdef LTC_ECC_PRIME239V3
274255 {
275 /* curve name */ { "PRIME239V3", NULL },
276 /* prime */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",
277 /* A */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",
278 /* B */ "255705FA2A306654B1F4CB03D6A750A30C250102D4988717D9BA15AB6D3E",
279 /* order */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF975DEB41B3A6057C3C432146526551",
280 /* Gx */ "6768AE8E18BB92CFCF005C949AA2C6D94853D0E660BBF854B1C9505FE95A",
281 /* Gy */ "1607E6898F390C06BC1D552BAD226F3B6FCFE48B6E818499AF18E3ED6CF3",
282 /* cofactor */ 1,
283 /* OID */ { 1,2,840,10045,3,1,6 }, 7
256 /* prime */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",
257 /* A */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",
258 /* B */ "255705FA2A306654B1F4CB03D6A750A30C250102D4988717D9BA15AB6D3E",
259 /* order */ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF975DEB41B3A6057C3C432146526551",
260 /* Gx */ "6768AE8E18BB92CFCF005C949AA2C6D94853D0E660BBF854B1C9505FE95A",
261 /* Gy */ "1607E6898F390C06BC1D552BAD226F3B6FCFE48B6E818499AF18E3ED6CF3",
262 /* cofactor */ 1,
263 /* OID */ "1.2.840.10045.3.1.6"
284264 },
285265 #endif
286266 #ifdef LTC_ECC_BRAINPOOLP160R1
287267 {
288 /* curve name */ { "BRAINPOOLP160R1", NULL },
289 /* prime */ "E95E4A5F737059DC60DFC7AD95B3D8139515620F",
290 /* A */ "340E7BE2A280EB74E2BE61BADA745D97E8F7C300",
291 /* B */ "1E589A8595423412134FAA2DBDEC95C8D8675E58",
292 /* order */ "E95E4A5F737059DC60DF5991D45029409E60FC09",
293 /* Gx */ "BED5AF16EA3F6A4F62938C4631EB5AF7BDBCDBC3",
294 /* Gy */ "1667CB477A1A8EC338F94741669C976316DA6321",
295 /* cofactor */ 1,
296 /* OID */ { 1,3,36,3,3,2,8,1,1,1 }, 10
268 /* prime */ "E95E4A5F737059DC60DFC7AD95B3D8139515620F",
269 /* A */ "340E7BE2A280EB74E2BE61BADA745D97E8F7C300",
270 /* B */ "1E589A8595423412134FAA2DBDEC95C8D8675E58",
271 /* order */ "E95E4A5F737059DC60DF5991D45029409E60FC09",
272 /* Gx */ "BED5AF16EA3F6A4F62938C4631EB5AF7BDBCDBC3",
273 /* Gy */ "1667CB477A1A8EC338F94741669C976316DA6321",
274 /* cofactor */ 1,
275 /* OID */ "1.3.36.3.3.2.8.1.1.1"
297276 },
298277 #endif
299278 #ifdef LTC_ECC_BRAINPOOLP192R1
300279 {
301 /* curve name */ { "BRAINPOOLP192R1", NULL },
302 /* prime */ "C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297",
303 /* A */ "6A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF",
304 /* B */ "469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9",
305 /* order */ "C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1",
306 /* Gx */ "C0A0647EAAB6A48753B033C56CB0F0900A2F5C4853375FD6",
307 /* Gy */ "14B690866ABD5BB88B5F4828C1490002E6773FA2FA299B8F",
308 /* cofactor */ 1,
309 /* OID */ { 1,3,36,3,3,2,8,1,1,3 }, 10
280 /* prime */ "C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297",
281 /* A */ "6A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF",
282 /* B */ "469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9",
283 /* order */ "C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1",
284 /* Gx */ "C0A0647EAAB6A48753B033C56CB0F0900A2F5C4853375FD6",
285 /* Gy */ "14B690866ABD5BB88B5F4828C1490002E6773FA2FA299B8F",
286 /* cofactor */ 1,
287 /* OID */ "1.3.36.3.3.2.8.1.1.3"
310288 },
311289 #endif
312290 #ifdef LTC_ECC_BRAINPOOLP224R1
313291 {
314 /* curve name */ { "BRAINPOOLP224R1", NULL },
315 /* prime */ "D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF",
316 /* A */ "68A5E62CA9CE6C1C299803A6C1530B514E182AD8B0042A59CAD29F43",
317 /* B */ "2580F63CCFE44138870713B1A92369E33E2135D266DBB372386C400B",
318 /* order */ "D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F",
319 /* Gx */ "0D9029AD2C7E5CF4340823B2A87DC68C9E4CE3174C1E6EFDEE12C07D",
320 /* Gy */ "58AA56F772C0726F24C6B89E4ECDAC24354B9E99CAA3F6D3761402CD",
321 /* cofactor */ 1,
322 /* OID */ { 1,3,36,3,3,2,8,1,1,5 }, 10
292 /* prime */ "D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF",
293 /* A */ "68A5E62CA9CE6C1C299803A6C1530B514E182AD8B0042A59CAD29F43",
294 /* B */ "2580F63CCFE44138870713B1A92369E33E2135D266DBB372386C400B",
295 /* order */ "D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F",
296 /* Gx */ "0D9029AD2C7E5CF4340823B2A87DC68C9E4CE3174C1E6EFDEE12C07D",
297 /* Gy */ "58AA56F772C0726F24C6B89E4ECDAC24354B9E99CAA3F6D3761402CD",
298 /* cofactor */ 1,
299 /* OID */ "1.3.36.3.3.2.8.1.1.5"
323300 },
324301 #endif
325302 #ifdef LTC_ECC_BRAINPOOLP256R1
326303 {
327 /* curve name */ { "BRAINPOOLP256R1", NULL },
328 /* prime */ "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377",
329 /* A */ "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9",
330 /* B */ "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6",
331 /* order */ "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7",
332 /* Gx */ "8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262",
333 /* Gy */ "547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997",
334 /* cofactor */ 1,
335 /* OID */ { 1,3,36,3,3,2,8,1,1,7 }, 10
304 /* prime */ "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377",
305 /* A */ "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9",
306 /* B */ "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6",
307 /* order */ "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7",
308 /* Gx */ "8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262",
309 /* Gy */ "547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997",
310 /* cofactor */ 1,
311 /* OID */ "1.3.36.3.3.2.8.1.1.7"
336312 },
337313 #endif
338314 #ifdef LTC_ECC_BRAINPOOLP320R1
339315 {
340 /* curve name */ { "BRAINPOOLP320R1", NULL },
341 /* prime */ "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27",
342 /* A */ "3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F492F375A97D860EB4",
343 /* B */ "520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD884539816F5EB4AC8FB1F1A6",
344 /* order */ "D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311",
345 /* Gx */ "43BD7E9AFB53D8B85289BCC48EE5BFE6F20137D10A087EB6E7871E2A10A599C710AF8D0D39E20611",
346 /* Gy */ "14FDD05545EC1CC8AB4093247F77275E0743FFED117182EAA9C77877AAAC6AC7D35245D1692E8EE1",
347 /* cofactor */ 1,
348 /* OID */ { 1,3,36,3,3,2,8,1,1,9 }, 10
316 /* prime */ "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27",
317 /* A */ "3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F492F375A97D860EB4",
318 /* B */ "520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD884539816F5EB4AC8FB1F1A6",
319 /* order */ "D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311",
320 /* Gx */ "43BD7E9AFB53D8B85289BCC48EE5BFE6F20137D10A087EB6E7871E2A10A599C710AF8D0D39E20611",
321 /* Gy */ "14FDD05545EC1CC8AB4093247F77275E0743FFED117182EAA9C77877AAAC6AC7D35245D1692E8EE1",
322 /* cofactor */ 1,
323 /* OID */ "1.3.36.3.3.2.8.1.1.9"
349324 },
350325 #endif
351326 #ifdef LTC_ECC_BRAINPOOLP384R1
352327 {
353 /* curve name */ { "BRAINPOOLP384R1", NULL },
354 /* prime */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53",
355 /* A */ "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826",
356 /* B */ "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11",
357 /* order */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565",
358 /* Gx */ "1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E",
359 /* Gy */ "8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315",
360 /* cofactor */ 1,
361 /* OID */ { 1,3,36,3,3,2,8,1,1,11 }, 10
328 /* prime */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53",
329 /* A */ "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826",
330 /* B */ "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11",
331 /* order */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565",
332 /* Gx */ "1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E",
333 /* Gy */ "8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315",
334 /* cofactor */ 1,
335 /* OID */ "1.3.36.3.3.2.8.1.1.11"
362336 },
363337 #endif
364338 #ifdef LTC_ECC_BRAINPOOLP512R1
365339 {
366 /* curve name */ { "BRAINPOOLP512R1", NULL },
367 /* prime */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3",
368 /* A */ "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA",
369 /* B */ "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723",
370 /* order */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069",
371 /* Gx */ "81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822",
372 /* Gy */ "7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892",
373 /* cofactor */ 1,
374 /* OID */ { 1,3,36,3,3,2,8,1,1,13 }, 10
340 /* prime */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3",
341 /* A */ "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA",
342 /* B */ "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723",
343 /* order */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069",
344 /* Gx */ "81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822",
345 /* Gy */ "7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892",
346 /* cofactor */ 1,
347 /* OID */ "1.3.36.3.3.2.8.1.1.13"
375348 },
376349 #endif
377350 #ifdef LTC_ECC_BRAINPOOLP160T1
378351 {
379 /* curve name */ { "BRAINPOOLP160T1", NULL },
380 /* prime */ "E95E4A5F737059DC60DFC7AD95B3D8139515620F",
381 /* A */ "E95E4A5F737059DC60DFC7AD95B3D8139515620C",
382 /* B */ "7A556B6DAE535B7B51ED2C4D7DAA7A0B5C55F380",
383 /* order */ "E95E4A5F737059DC60DF5991D45029409E60FC09",
384 /* Gx */ "B199B13B9B34EFC1397E64BAEB05ACC265FF2378",
385 /* Gy */ "ADD6718B7C7C1961F0991B842443772152C9E0AD",
386 /* cofactor */ 1,
387 /* OID */ { 1,3,36,3,3,2,8,1,1,2 }, 10
352 /* prime */ "E95E4A5F737059DC60DFC7AD95B3D8139515620F",
353 /* A */ "E95E4A5F737059DC60DFC7AD95B3D8139515620C",
354 /* B */ "7A556B6DAE535B7B51ED2C4D7DAA7A0B5C55F380",
355 /* order */ "E95E4A5F737059DC60DF5991D45029409E60FC09",
356 /* Gx */ "B199B13B9B34EFC1397E64BAEB05ACC265FF2378",
357 /* Gy */ "ADD6718B7C7C1961F0991B842443772152C9E0AD",
358 /* cofactor */ 1,
359 /* OID */ "1.3.36.3.3.2.8.1.1.2"
388360 },
389361 #endif
390362 #ifdef LTC_ECC_BRAINPOOLP192T1
391363 {
392 /* curve name */ { "BRAINPOOLP192T1", NULL },
393 /* prime */ "C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297",
394 /* A */ "C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86294",
395 /* B */ "13D56FFAEC78681E68F9DEB43B35BEC2FB68542E27897B79",
396 /* order */ "C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1",
397 /* Gx */ "3AE9E58C82F63C30282E1FE7BBF43FA72C446AF6F4618129",
398 /* Gy */ "097E2C5667C2223A902AB5CA449D0084B7E5B3DE7CCC01C9",
399 /* cofactor */ 1,
400 /* OID */ { 1,3,36,3,3,2,8,1,1,4 }, 10
364 /* prime */ "C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297",
365 /* A */ "C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86294",
366 /* B */ "13D56FFAEC78681E68F9DEB43B35BEC2FB68542E27897B79",
367 /* order */ "C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1",
368 /* Gx */ "3AE9E58C82F63C30282E1FE7BBF43FA72C446AF6F4618129",
369 /* Gy */ "097E2C5667C2223A902AB5CA449D0084B7E5B3DE7CCC01C9",
370 /* cofactor */ 1,
371 /* OID */ "1.3.36.3.3.2.8.1.1.4"
401372 },
402373 #endif
403374 #ifdef LTC_ECC_BRAINPOOLP224T1
404375 {
405 /* curve name */ { "BRAINPOOLP224T1", NULL },
406 /* prime */ "D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF",
407 /* A */ "D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FC",
408 /* B */ "4B337D934104CD7BEF271BF60CED1ED20DA14C08B3BB64F18A60888D",
409 /* order */ "D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F",
410 /* Gx */ "6AB1E344CE25FF3896424E7FFE14762ECB49F8928AC0C76029B4D580",
411 /* Gy */ "0374E9F5143E568CD23F3F4D7C0D4B1E41C8CC0D1C6ABD5F1A46DB4C",
412 /* cofactor */ 1,
413 /* OID */ { 1,3,36,3,3,2,8,1,1,6 }, 10
376 /* prime */ "D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF",
377 /* A */ "D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FC",
378 /* B */ "4B337D934104CD7BEF271BF60CED1ED20DA14C08B3BB64F18A60888D",
379 /* order */ "D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F",
380 /* Gx */ "6AB1E344CE25FF3896424E7FFE14762ECB49F8928AC0C76029B4D580",
381 /* Gy */ "0374E9F5143E568CD23F3F4D7C0D4B1E41C8CC0D1C6ABD5F1A46DB4C",
382 /* cofactor */ 1,
383 /* OID */ "1.3.36.3.3.2.8.1.1.6"
414384 },
415385 #endif
416386 #ifdef LTC_ECC_BRAINPOOLP256T1
417387 {
418 /* curve name */ { "BRAINPOOLP256T1", NULL },
419 /* prime */ "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377",
420 /* A */ "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5374",
421 /* B */ "662C61C430D84EA4FE66A7733D0B76B7BF93EBC4AF2F49256AE58101FEE92B04",
422 /* order */ "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7",
423 /* Gx */ "A3E8EB3CC1CFE7B7732213B23A656149AFA142C47AAFBC2B79A191562E1305F4",
424 /* Gy */ "2D996C823439C56D7F7B22E14644417E69BCB6DE39D027001DABE8F35B25C9BE",
425 /* cofactor */ 1,
426 /* OID */ { 1,3,36,3,3,2,8,1,1,8 }, 10
388 /* prime */ "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377",
389 /* A */ "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5374",
390 /* B */ "662C61C430D84EA4FE66A7733D0B76B7BF93EBC4AF2F49256AE58101FEE92B04",
391 /* order */ "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7",
392 /* Gx */ "A3E8EB3CC1CFE7B7732213B23A656149AFA142C47AAFBC2B79A191562E1305F4",
393 /* Gy */ "2D996C823439C56D7F7B22E14644417E69BCB6DE39D027001DABE8F35B25C9BE",
394 /* cofactor */ 1,
395 /* OID */ "1.3.36.3.3.2.8.1.1.8"
427396 },
428397 #endif
429398 #ifdef LTC_ECC_BRAINPOOLP320T1
430399 {
431 /* curve name */ { "BRAINPOOLP320T1", NULL },
432 /* prime */ "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27",
433 /* A */ "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E24",
434 /* B */ "A7F561E038EB1ED560B3D147DB782013064C19F27ED27C6780AAF77FB8A547CEB5B4FEF422340353",
435 /* order */ "D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311",
436 /* Gx */ "925BE9FB01AFC6FB4D3E7D4990010F813408AB106C4F09CB7EE07868CC136FFF3357F624A21BED52",
437 /* Gy */ "63BA3A7A27483EBF6671DBEF7ABB30EBEE084E58A0B077AD42A5A0989D1EE71B1B9BC0455FB0D2C3",
438 /* cofactor */ 1,
439 /* OID */ { 1,3,36,3,3,2,8,1,1,10 }, 10
400 /* prime */ "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27",
401 /* A */ "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E24",
402 /* B */ "A7F561E038EB1ED560B3D147DB782013064C19F27ED27C6780AAF77FB8A547CEB5B4FEF422340353",
403 /* order */ "D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311",
404 /* Gx */ "925BE9FB01AFC6FB4D3E7D4990010F813408AB106C4F09CB7EE07868CC136FFF3357F624A21BED52",
405 /* Gy */ "63BA3A7A27483EBF6671DBEF7ABB30EBEE084E58A0B077AD42A5A0989D1EE71B1B9BC0455FB0D2C3",
406 /* cofactor */ 1,
407 /* OID */ "1.3.36.3.3.2.8.1.1.10"
440408 },
441409 #endif
442410 #ifdef LTC_ECC_BRAINPOOLP384T1
443411 {
444 /* curve name */ { "BRAINPOOLP384T1", NULL },
445 /* prime */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53",
446 /* A */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC50",
447 /* B */ "7F519EADA7BDA81BD826DBA647910F8C4B9346ED8CCDC64E4B1ABD11756DCE1D2074AA263B88805CED70355A33B471EE",
448 /* order */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565",
449 /* Gx */ "18DE98B02DB9A306F2AFCD7235F72A819B80AB12EBD653172476FECD462AABFFC4FF191B946A5F54D8D0AA2F418808CC",
450 /* Gy */ "25AB056962D30651A114AFD2755AD336747F93475B7A1FCA3B88F2B6A208CCFE469408584DC2B2912675BF5B9E582928",
451 /* cofactor */ 1,
452 /* OID */ { 1,3,36,3,3,2,8,1,1,12 }, 10
412 /* prime */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53",
413 /* A */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC50",
414 /* B */ "7F519EADA7BDA81BD826DBA647910F8C4B9346ED8CCDC64E4B1ABD11756DCE1D2074AA263B88805CED70355A33B471EE",
415 /* order */ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565",
416 /* Gx */ "18DE98B02DB9A306F2AFCD7235F72A819B80AB12EBD653172476FECD462AABFFC4FF191B946A5F54D8D0AA2F418808CC",
417 /* Gy */ "25AB056962D30651A114AFD2755AD336747F93475B7A1FCA3B88F2B6A208CCFE469408584DC2B2912675BF5B9E582928",
418 /* cofactor */ 1,
419 /* OID */ "1.3.36.3.3.2.8.1.1.12"
453420 },
454421 #endif
455422 #ifdef LTC_ECC_BRAINPOOLP512T1
456423 {
457 /* curve name */ { "BRAINPOOLP512T1", NULL },
458 /* prime */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3",
459 /* A */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F0",
460 /* B */ "7CBBBCF9441CFAB76E1890E46884EAE321F70C0BCB4981527897504BEC3E36A62BCDFA2304976540F6450085F2DAE145C22553B465763689180EA2571867423E",
461 /* order */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069",
462 /* Gx */ "640ECE5C12788717B9C1BA06CBC2A6FEBA85842458C56DDE9DB1758D39C0313D82BA51735CDB3EA499AA77A7D6943A64F7A3F25FE26F06B51BAA2696FA9035DA",
463 /* Gy */ "5B534BD595F5AF0FA2C892376C84ACE1BB4E3019B71634C01131159CAE03CEE9D9932184BEEF216BD71DF2DADF86A627306ECFF96DBB8BACE198B61E00F8B332",
464 /* cofactor */ 1,
465 /* OID */ { 1,3,36,3,3,2,8,1,1,14 }, 10
466 },
467 #endif
468 {
469 { NULL },
470 NULL, NULL, NULL, NULL, NULL, NULL,
471 0,
472 { 0 }, 0
424 /* prime */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3",
425 /* A */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F0",
426 /* B */ "7CBBBCF9441CFAB76E1890E46884EAE321F70C0BCB4981527897504BEC3E36A62BCDFA2304976540F6450085F2DAE145C22553B465763689180EA2571867423E",
427 /* order */ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069",
428 /* Gx */ "640ECE5C12788717B9C1BA06CBC2A6FEBA85842458C56DDE9DB1758D39C0313D82BA51735CDB3EA499AA77A7D6943A64F7A3F25FE26F06B51BAA2696FA9035DA",
429 /* Gy */ "5B534BD595F5AF0FA2C892376C84ACE1BB4E3019B71634C01131159CAE03CEE9D9932184BEEF216BD71DF2DADF86A627306ECFF96DBB8BACE198B61E00F8B332",
430 /* cofactor */ 1,
431 /* OID */ "1.3.36.3.3.2.8.1.1.14"
432 },
433 #endif
434 {
435 NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL
473436 }
474437 };
475438
0 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
1 *
2 * LibTomCrypt is a library that provides various cryptographic
3 * algorithms in a highly modular and flexible manner.
4 *
5 * The library is free for all purposes without any express
6 * guarantee it works.
7 */
8
9 #include "tomcrypt.h"
10
11 #ifdef LTC_MECC
12
13 const struct {
14 const char *OID;
15 const char *names[6];
16 } _curve_names[] = {
17 #if defined(LTC_ECC_SECP112R1) || defined(LTC_ECC112)
18 {
19 "1.3.132.0.6", { "SECP112R1", "ECC-112", NULL }
20 },
21 #endif
22 #ifdef LTC_ECC_SECP112R2
23 {
24 "1.3.132.0.7", { "SECP112R2", NULL }
25 },
26 #endif
27 #if defined(LTC_ECC_SECP128R1) || defined(LTC_ECC128)
28 {
29 "1.3.132.0.28", { "SECP128R1", "ECC-128", NULL }
30 },
31 #endif
32 #ifdef LTC_ECC_SECP128R2
33 {
34 "1.3.132.0.29", { "SECP128R2", NULL }
35 },
36 #endif
37 #if defined(LTC_ECC_SECP160R1) || defined(LTC_ECC160)
38 {
39 "1.3.132.0.8", { "SECP160R1", "ECC-160", NULL }
40 },
41 #endif
42 #ifdef LTC_ECC_SECP160R2
43 {
44 "1.3.132.0.30", { "SECP160R2", NULL }
45 },
46 #endif
47 #ifdef LTC_ECC_SECP160K1
48 {
49 "1.3.132.0.9", { "SECP160K1", NULL }
50 },
51 #endif
52 #if defined(LTC_ECC_SECP192R1) || defined(LTC_ECC192)
53 {
54 "1.2.840.10045.3.1.1", { "SECP192R1", "NISTP192", "PRIME192V1", "ECC-192", "P-192", NULL }
55 },
56 #endif
57 #ifdef LTC_ECC_PRIME192V2
58 {
59 "1.2.840.10045.3.1.2", { "PRIME192V2", NULL }
60 },
61 #endif
62 #ifdef LTC_ECC_PRIME192V3
63 {
64 "1.2.840.10045.3.1.3", { "PRIME192V3", NULL }
65 },
66 #endif
67 #ifdef LTC_ECC_SECP192K1
68 {
69 "1.3.132.0.31", { "SECP192K1", NULL }
70 },
71 #endif
72 #if defined(LTC_ECC_SECP224R1) || defined(LTC_ECC224)
73 {
74 "1.3.132.0.33", { "SECP224R1", "NISTP224", "ECC-224", "P-224", NULL }
75 },
76 #endif
77 #ifdef LTC_ECC_SECP224K1
78 {
79 "1.3.132.0.32", { "SECP224K1", NULL }
80 },
81 #endif
82 #if defined(LTC_ECC_SECP256R1) || defined(LTC_ECC256)
83 {
84 "1.2.840.10045.3.1.7", { "SECP256R1", "NISTP256", "PRIME256V1", "ECC-256", "P-256", NULL }
85 },
86 #endif
87 #ifdef LTC_ECC_SECP256K1
88 {
89 "1.3.132.0.10", { "SECP256K1", NULL }
90 },
91 #endif
92 #if defined(LTC_ECC_SECP384R1) || defined(LTC_ECC384)
93 {
94 "1.3.132.0.34", { "SECP384R1", "NISTP384", "ECC-384", "P-384", NULL }
95 },
96 #endif
97 #if defined(LTC_ECC_SECP521R1) || defined(LTC_ECC521)
98 {
99 "1.3.132.0.35", { "SECP521R1", "NISTP521", "ECC-521", "P-521", NULL }
100 },
101 #endif
102 #ifdef LTC_ECC_PRIME239V1
103 {
104 "1.2.840.10045.3.1.4", { "PRIME239V1", NULL }
105 },
106 #endif
107 #ifdef LTC_ECC_PRIME239V2
108 {
109 "1.2.840.10045.3.1.5", { "PRIME239V2", NULL }
110 },
111 #endif
112 #ifdef LTC_ECC_PRIME239V3
113 {
114 "1.2.840.10045.3.1.6", { "PRIME239V3", NULL }
115 },
116 #endif
117 #ifdef LTC_ECC_BRAINPOOLP160R1
118 {
119 "1.3.36.3.3.2.8.1.1.1", { "BRAINPOOLP160R1", NULL }
120 },
121 #endif
122 #ifdef LTC_ECC_BRAINPOOLP192R1
123 {
124 "1.3.36.3.3.2.8.1.1.3", { "BRAINPOOLP192R1", NULL }
125 },
126 #endif
127 #ifdef LTC_ECC_BRAINPOOLP224R1
128 {
129 "1.3.36.3.3.2.8.1.1.5", { "BRAINPOOLP224R1", NULL }
130 },
131 #endif
132 #ifdef LTC_ECC_BRAINPOOLP256R1
133 {
134 "1.3.36.3.3.2.8.1.1.7", { "BRAINPOOLP256R1", NULL }
135 },
136 #endif
137 #ifdef LTC_ECC_BRAINPOOLP320R1
138 {
139 "1.3.36.3.3.2.8.1.1.9", { "BRAINPOOLP320R1", NULL }
140 },
141 #endif
142 #ifdef LTC_ECC_BRAINPOOLP384R1
143 {
144 "1.3.36.3.3.2.8.1.1.11", { "BRAINPOOLP384R1", NULL }
145 },
146 #endif
147 #ifdef LTC_ECC_BRAINPOOLP512R1
148 {
149 "1.3.36.3.3.2.8.1.1.13", { "BRAINPOOLP512R1", NULL }
150 },
151 #endif
152 #ifdef LTC_ECC_BRAINPOOLP160T1
153 {
154 "1.3.36.3.3.2.8.1.1.2", { "BRAINPOOLP160T1", NULL }
155 },
156 #endif
157 #ifdef LTC_ECC_BRAINPOOLP192T1
158 {
159 "1.3.36.3.3.2.8.1.1.4", { "BRAINPOOLP192T1", NULL }
160 },
161 #endif
162 #ifdef LTC_ECC_BRAINPOOLP224T1
163 {
164 "1.3.36.3.3.2.8.1.1.6", { "BRAINPOOLP224T1", NULL }
165 },
166 #endif
167 #ifdef LTC_ECC_BRAINPOOLP256T1
168 {
169 "1.3.36.3.3.2.8.1.1.8", { "BRAINPOOLP256T1", NULL }
170 },
171 #endif
172 #ifdef LTC_ECC_BRAINPOOLP320T1
173 {
174 "1.3.36.3.3.2.8.1.1.10", { "BRAINPOOLP320T1", NULL }
175 },
176 #endif
177 #ifdef LTC_ECC_BRAINPOOLP384T1
178 {
179 "1.3.36.3.3.2.8.1.1.12", { "BRAINPOOLP384T1", NULL }
180 },
181 #endif
182 #ifdef LTC_ECC_BRAINPOOLP512T1
183 {
184 "1.3.36.3.3.2.8.1.1.14", { "BRAINPOOLP512T1", NULL }
185 },
186 #endif
187 {
188 NULL, { NULL }
189 }
190 };
191
192 /* case-insensitive match + ignore '-', '_', ' ' */
193 static int _name_match(const char *left, const char *right)
194 {
195 char lc_r, lc_l;
196
197 while ((*left != '\0') && (*right != '\0')) {
198 while ((*left == ' ') || (*left == '-') || (*left == '_')) left++;
199 while ((*right == ' ') || (*right == '-') || (*right == '_')) right++;
200 if (*left == '\0' || *right == '\0') break;
201 lc_r = *right;
202 lc_l = *left;
203 if ((lc_r >= 'A') && (lc_r <= 'Z')) lc_r += 32;
204 if ((lc_l >= 'A') && (lc_l <= 'Z')) lc_l += 32;
205 if (lc_l != lc_r) return 0;
206 left++;
207 right++;
208 }
209
210 if ((*left == '\0') && (*right == '\0'))
211 return 1;
212 else
213 return 0;
214 }
215
216 int ecc_get_curve(const char *name_or_oid, const ltc_ecc_curve **cu)
217 {
218 int i, j;
219 const char *OID = NULL;
220
221 LTC_ARGCHK(cu != NULL);
222 LTC_ARGCHK(name_or_oid != NULL);
223
224 *cu = NULL;
225
226 for (i = 0; _curve_names[i].OID != NULL && !OID; i++) {
227 if (XSTRCMP(_curve_names[i].OID, name_or_oid) == 0) {
228 OID = _curve_names[i].OID;
229 }
230 for (j = 0; _curve_names[i].names[j] != NULL && !OID; j++) {
231 if (_name_match(_curve_names[i].names[j], name_or_oid)) {
232 OID = _curve_names[i].OID;
233 }
234 }
235 }
236
237 if (OID != NULL) {
238 for (i = 0; ltc_ecc_curves[i].prime != NULL; i++) {
239 if (XSTRCMP(ltc_ecc_curves[i].OID, OID) == 0) {
240 *cu = &ltc_ecc_curves[i];
241 return CRYPT_OK;
242 }
243 }
244 }
245
246 return CRYPT_INVALID_ARG; /* not found */
247 }
248
249 #endif
250
251 /* ref: $Format:%D$ */
252 /* git commit: $Format:%H$ */
253 /* commit time: $Format:%ai$ */
+0
-63
src/ltc/pk/ecc/ecc_get_curve_by_name.c less more
0 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
1 *
2 * LibTomCrypt is a library that provides various cryptographic
3 * algorithms in a highly modular and flexible manner.
4 *
5 * The library is free for all purposes without any express
6 * guarantee it works.
7 */
8
9 #include "tomcrypt.h"
10
11 #ifdef LTC_MECC
12
13 /* case-insensitive match + ignore '-', '_', ' ' */
14 static int _name_match(const char *left, const char *right)
15 {
16 char lc_r, lc_l;
17
18 while ((*left != '\0') && (*right != '\0')) {
19 while ((*left == ' ') || (*left == '-') || (*left == '_')) left++;
20 while ((*right == ' ') || (*right == '-') || (*right == '_')) right++;
21 if (*left == '\0' || *right == '\0') break;
22 lc_r = *right;
23 lc_l = *left;
24 if ((lc_r >= 'A') && (lc_r <= 'Z')) lc_r += 32;
25 if ((lc_l >= 'A') && (lc_l <= 'Z')) lc_l += 32;
26 if (lc_l != lc_r) return 0;
27 left++;
28 right++;
29 }
30
31 if ((*left == '\0') && (*right == '\0'))
32 return 1;
33 else
34 return 0;
35 }
36
37 int ecc_get_curve_by_name(const char *name, const ltc_ecc_curve **cu)
38 {
39 int i, j;
40
41 LTC_ARGCHK(cu != NULL);
42 LTC_ARGCHK(name != NULL);
43
44 *cu = NULL;
45
46 for (i = 0; ltc_ecc_curves[i].prime != NULL; i++) {
47 for (j = 0; ltc_ecc_curves[i].names[j] != NULL; j++) {
48 if (_name_match(ltc_ecc_curves[i].names[j], name)) {
49 *cu = &ltc_ecc_curves[i];
50 return CRYPT_OK;
51 }
52 }
53 }
54
55 return CRYPT_INVALID_ARG; /* not found */
56 }
57
58 #endif
59
60 /* ref: $Format:%D$ */
61 /* git commit: $Format:%H$ */
62 /* commit time: $Format:%ai$ */
1717 unsigned char bin_a[ECC_MAXSIZE], bin_b[ECC_MAXSIZE], bin_k[ECC_MAXSIZE], bin_g[2*ECC_MAXSIZE+1], bin_xy[2*ECC_MAXSIZE+2], bin_seed[128];
1818 unsigned long len_a, len_b, len_k, len_g, len_xy, len_oid, len;
1919 unsigned long cofactor = 0, ecver = 0, pkver = 0, tmpoid[16], curveoid[16];
20 char OID[256];
21 const ltc_ecc_curve *curve;
2022 int err;
2123
2224 if ((err = mp_init_multi(&prime, &order, &a, &b, &gx, &gy, NULL)) != CRYPT_OK) {
3032 err = x509_decode_subject_public_key_info(in, inlen, PKA_EC, bin_xy, &len_xy, LTC_ASN1_OBJECT_IDENTIFIER, (void *)curveoid, &len_oid);
3133 if (err == CRYPT_OK) {
3234 /* load curve parameters for given curve OID */
33 if ((err = ecc_set_dp_by_oid(curveoid, len_oid, key)) != CRYPT_OK) { goto error; }
35 len = sizeof(OID);
36 if ((err = pk_oid_num_to_str(curveoid, len_oid, OID, &len)) != CRYPT_OK) { goto error; }
37 if ((err = ecc_get_curve(OID, &curve)) != CRYPT_OK) { goto error; }
38 if ((err = ecc_set_dp(curve, key)) != CRYPT_OK) { goto error; }
3439 /* load public key */
35 if ((err = ecc_set_key(bin_xy, len_xy, PK_PUBLIC, key)) != CRYPT_OK) { goto error; }
40 if ((err = ecc_set_key(bin_xy, len_xy, PK_PUBLIC, key)) != CRYPT_OK) { goto error; }
3641 goto success;
3742 }
3843
8893 err = der_decode_sequence(in, inlen, seq_priv, 4);
8994 if (err == CRYPT_OK) {
9095 /* load curve parameters for given curve OID */
91 if ((err = ecc_set_dp_by_oid(curveoid, custom[0].size, key)) != CRYPT_OK) { goto error; }
96 len = sizeof(OID);
97 if ((err = pk_oid_num_to_str(curveoid, custom[0].size, OID, &len)) != CRYPT_OK) { goto error; }
98 if ((err = ecc_get_curve(OID, &curve)) != CRYPT_OK) { goto error; }
99 if ((err = ecc_set_dp(curve, key)) != CRYPT_OK) { goto error; }
92100 /* load private+public key */
93 if ((err = ecc_set_key(bin_k, seq_priv[1].size, PK_PRIVATE, key)) != CRYPT_OK) { goto error; }
101 if ((err = ecc_set_key(bin_k, seq_priv[1].size, PK_PRIVATE, key)) != CRYPT_OK) { goto error; }
94102 goto success;
95103 }
96104
459459 unsigned long len, cofactor;
460460 oid_st ecoid;
461461 int err;
462 char OID[256];
463 const ltc_ecc_curve *curve;
462464 ltc_asn1_list *p = NULL, *l = NULL;
463465
464466 LTC_ARGCHK(in != NULL);
499501 * 23:d=1 hl=2 l= 77 prim: OCTET STRING :bytes (== privatekey)
500502 */
501503 ltc_asn1_list *loid = lseq->child->next;
502 if ((err = ecc_set_dp_by_oid(loid->data, loid->size, key)) != CRYPT_OK) {
503 goto LBL_DONE;
504 }
504 len = sizeof(OID);
505 if ((err = pk_oid_num_to_str(loid->data, loid->size, OID, &len)) != CRYPT_OK) { goto LBL_DONE; }
506 if ((err = ecc_get_curve(OID, &curve)) != CRYPT_OK) { goto LBL_DONE; }
507 if ((err = ecc_set_dp(curve, key)) != CRYPT_OK) { goto LBL_DONE; }
505508 }
506509 else if (lseq->child->next && lseq->child->next->type == LTC_ASN1_SEQUENCE) {
507510 /* CASE 2: explicit curve parameters (AKA long variant):
1212
1313 int ecc_set_dp(const ltc_ecc_curve *curve, ecc_key *key)
1414 {
15 unsigned long i;
1615 int err;
1716
1817 LTC_ARGCHK(key != NULL);
3635 /* cofactor & size */
3736 key->dp.cofactor = curve->cofactor;
3837 key->dp.size = mp_unsigned_bin_size(key->dp.prime);
39 /* OID */
40 key->dp.oidlen = curve->oidlen;
41 for (i = 0; i < key->dp.oidlen; i++) key->dp.oid[i] = curve->oid[i];
38 /* OID string >> unsigned long oid[16] + oidlen */
39 key->dp.oidlen = 16;
40 if ((err = pk_oid_str_to_num(curve->OID, key->dp.oid, &key->dp.oidlen)) != CRYPT_OK) { goto error; }
4241 /* success */
4342 return CRYPT_OK;
4443
5453
5554 /* for compatibility with libtomcrypt-1.17 the sizes below must match the specific curves */
5655 if (size <= 14) {
57 err = ecc_get_curve_by_name("SECP112R1", &cu);
56 err = ecc_get_curve("SECP112R1", &cu);
5857 }
5958 else if (size <= 16) {
60 err = ecc_get_curve_by_name("SECP128R1", &cu);
59 err = ecc_get_curve("SECP128R1", &cu);
6160 }
6261 else if (size <= 20) {
63 err = ecc_get_curve_by_name("SECP160R1", &cu);
62 err = ecc_get_curve("SECP160R1", &cu);
6463 }
6564 else if (size <= 24) {
66 err = ecc_get_curve_by_name("SECP192R1", &cu);
65 err = ecc_get_curve("SECP192R1", &cu);
6766 }
6867 else if (size <= 28) {
69 err = ecc_get_curve_by_name("SECP224R1", &cu);
68 err = ecc_get_curve("SECP224R1", &cu);
7069 }
7170 else if (size <= 32) {
72 err = ecc_get_curve_by_name("SECP256R1", &cu);
71 err = ecc_get_curve("SECP256R1", &cu);
7372 }
7473 else if (size <= 48) {
75 err = ecc_get_curve_by_name("SECP384R1", &cu);
74 err = ecc_get_curve("SECP384R1", &cu);
7675 }
7776 else if (size <= 66) {
78 err = ecc_get_curve_by_name("SECP521R1", &cu);
77 err = ecc_get_curve("SECP521R1", &cu);
7978 }
8079
8180 if (err == CRYPT_OK && cu != NULL) return ecc_set_dp(cu, key);
1010
1111 #ifdef LTC_MECC
1212
13 static int _ecc_cmp_hex_bn(const char *left_hex, void *right_bn, void *tmp_bn)
14 {
15 if (mp_read_radix(tmp_bn, left_hex, 16) != CRYPT_OK) return 0;
16 if (mp_cmp(tmp_bn, right_bn) != LTC_MP_EQ) return 0;
17 return 1;
18 }
19
1320 static void _ecc_oid_lookup(ecc_key *key)
1421 {
15 int err;
16 unsigned i;
17 void *tmp;
22 void *bn;
1823 const ltc_ecc_curve *curve;
1924
2025 key->dp.oidlen = 0;
21 if ((err = mp_init(&tmp)) != CRYPT_OK) return;
26 if (mp_init(&bn) != CRYPT_OK) return;
2227 for (curve = ltc_ecc_curves; curve->prime != NULL; curve++) {
23 if ((err = mp_read_radix(tmp, curve->prime, 16)) != CRYPT_OK) continue;
24 if ((mp_cmp(tmp, key->dp.prime) != LTC_MP_EQ)) continue;
25 if ((err = mp_read_radix(tmp, curve->order, 16)) != CRYPT_OK) continue;
26 if ((mp_cmp(tmp, key->dp.order) != LTC_MP_EQ)) continue;
27 if ((err = mp_read_radix(tmp, curve->A, 16)) != CRYPT_OK) continue;
28 if ((mp_cmp(tmp, key->dp.A) != LTC_MP_EQ)) continue;
29 if ((err = mp_read_radix(tmp, curve->B, 16)) != CRYPT_OK) continue;
30 if ((mp_cmp(tmp, key->dp.B) != LTC_MP_EQ)) continue;
31 if ((err = mp_read_radix(tmp, curve->Gx, 16)) != CRYPT_OK) continue;
32 if ((mp_cmp(tmp, key->dp.base.x) != LTC_MP_EQ)) continue;
33 if ((err = mp_read_radix(tmp, curve->Gy, 16)) != CRYPT_OK) continue;
34 if ((mp_cmp(tmp, key->dp.base.y) != LTC_MP_EQ)) continue;
35 if (key->dp.cofactor != curve->cofactor) continue;
28 if (_ecc_cmp_hex_bn(curve->prime, key->dp.prime, bn) != 1) continue;
29 if (_ecc_cmp_hex_bn(curve->order, key->dp.order, bn) != 1) continue;
30 if (_ecc_cmp_hex_bn(curve->A, key->dp.A, bn) != 1) continue;
31 if (_ecc_cmp_hex_bn(curve->B, key->dp.B, bn) != 1) continue;
32 if (_ecc_cmp_hex_bn(curve->Gx, key->dp.base.x, bn) != 1) continue;
33 if (_ecc_cmp_hex_bn(curve->Gy, key->dp.base.y, bn) != 1) continue;
34 if (key->dp.cofactor != curve->cofactor) continue;
3635 break; /* found */
3736 }
38 mp_clear(tmp);
39 if (curve->prime != NULL) {
40 /* OID found */
41 key->dp.oidlen = curve->oidlen;
42 for(i = 0; i < curve->oidlen; i++) key->dp.oid[i] = curve->oid[i];
37 mp_clear(bn);
38 if (curve->prime && curve->OID) {
39 key->dp.oidlen = 16; /* size of key->dp.oid */
40 pk_oid_str_to_num(curve->OID, key->dp.oid, &key->dp.oidlen);
4341 }
44 }
45
46 int ecc_set_dp_by_oid(unsigned long *oid, unsigned long oidsize, ecc_key *key)
47 {
48 int i;
49
50 LTC_ARGCHK(oid != NULL);
51 LTC_ARGCHK(oidsize > 0);
52
53 for(i = 0; ltc_ecc_curves[i].prime != NULL; i++) {
54 if ((oidsize == ltc_ecc_curves[i].oidlen) &&
55 (XMEM_NEQ(oid, ltc_ecc_curves[i].oid, sizeof(unsigned long) * ltc_ecc_curves[i].oidlen) == 0)) {
56 break;
57 }
58 }
59 if (ltc_ecc_curves[i].prime == NULL) return CRYPT_ERROR; /* not found */
60 return ecc_set_dp(&ltc_ecc_curves[i], key);
6142 }
6243
6344 int ecc_copy_dp(const ecc_key *srckey, ecc_key *key)