Update keys.c
2022-02-22 changes to "keys.c":
Added BrainPool-384/512 curve definitions
Incremented ELLIP_CURVES_NUM
Removed "expectedBits" structure element and array entries (unused, values source(s) lost, not really necessary)
galaxiesFarApart authored 2 years ago
GitHub committed 2 years ago
53 | 53 | multi_precision_integer("RSA e"); |
54 | 54 | } |
55 | 55 | |
56 | /* added: 2021-11-11 | |
56 | /* added: 2021-11-11; extended: 2022-02-21 (BrainPool 384,512; RFC5639) | |
57 | 57 | * Reference: draft-ietf-openpgp-crypto-refresh-04 (10/2021);section 9.2 ECC Curves for OpenPGP |
58 | 58 | * https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-04.html |
59 | 59 | * Note (2021-11-25): actual ECC curve hex OID padded to 10 to match incoming oid array length |
60 | 60 | * so that memcmp will work properly (compare two values of the same size) |
61 | 61 | */ |
62 | 62 | private unsigned char BrainPool256r1_OID[10]={0x2B,0x24,0x3,0x3,0x2,0x8,0x1,0x1,0x7,0}; |
63 | private unsigned char BrainPool384r1_OID[10]={0x2B,0x24,0x3,0x3,0x2,0x8,0x1,0x1,0x0b,0}; | |
64 | private unsigned char BrainPool512r1_OID[10]={0x2B,0x24,0x3,0x3,0x2,0x8,0x1,0x1,0x0d,0}; | |
63 | 65 | private unsigned char NIST_P256_OID[10]={0x2A,0x86,0x48,0xCE,0x3D,0x3,0x1,0x7,0,0}; |
64 | 66 | private unsigned char NIST_P384_OID[10]={0x2B,0x81,0x04,0x00,0x22,0,0,0,0,0}; |
65 | 67 | private unsigned char NIST_P521_OID[10]={0x2B,0x81,0x04,0x00,0x23,0,0,0,0,0}; |
78 | 80 | const unsigned char *oidhex; |
79 | 81 | const char *name; |
80 | 82 | const char *oidstring; |
81 | const int expectedBits; | |
82 | 83 | } ELLIP_CURVES[] = { |
83 | {NIST_P256_OID,"NIST P-256","0x2A 86 48 CE 3D 03 01 07",515}, | |
84 | {NIST_P384_OID,"NIST P-384","0x2B 81 04 00 22",771}, | |
85 | {NIST_P521_OID,"NIST P-521","0x2B 81 04 00 23",1059}, | |
86 | {Ed25519_OID,"Ed25519","0x2B 06 01 04 01 DA 47 0F 01",263}, | |
87 | {Ed448_OID,"Ed448","0x2B 65 71",463}, | |
88 | {Curve25519_OID,"Curve25519","0x2B 06 01 04 01 97 55 01 05 01",263}, | |
89 | {X448_OID,"X448","0x2B 65 6F",445}, | |
90 | {BrainPool256r1_OID,"brainpoolP256r1","0x2B 24 03 03 02 08 01 01 07",515} | |
84 | {NIST_P256_OID,"NIST P-256","0x2A 86 48 CE 3D 03 01 07"}, | |
85 | {NIST_P384_OID,"NIST P-384","0x2B 81 04 00 22"}, | |
86 | {NIST_P521_OID,"NIST P-521","0x2B 81 04 00 23"}, | |
87 | {Ed25519_OID,"Ed25519","0x2B 06 01 04 01 DA 47 0F 01"}, | |
88 | {Ed448_OID,"Ed448","0x2B 65 71"}, | |
89 | {Curve25519_OID,"Curve25519","0x2B 06 01 04 01 97 55 01 05 01"}, | |
90 | {X448_OID,"X448","0x2B 65 6F"}, | |
91 | {BrainPool256r1_OID,"brainpoolP256r1","0x2B 24 03 03 02 08 01 01 07"}, | |
92 | {BrainPool384r1_OID,"BrainPoolP384r1","0x2B 24 03 03 02 08 01 01 07 0b"}, | |
93 | {BrainPool512r1_OID,"BrainPoolP512r1","0x2B 24 03 03 02 08 01 01 07 0d"} | |
91 | 94 | }; |
92 | #define ELLIP_CURVES_NUM 8 | |
95 | #define ELLIP_CURVES_NUM 10 | |
93 | 96 | |
94 | 97 | /* end 2021-11-11 */ |
95 | 98 |