This project implements the Dragonfly Key Exchange in C++. The implementation uses Brainpool elliptic curve parameters as specified in RFC5639.
The following Brainpool curve parameters can be used and customised specified in src/peer.cpp:
// Try out Curve-ID: brainpoolP256t1
mpz_init_set_str(this->p, "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", 16);
mpz_init_set_str(this->a, "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", 16);
mpz_init_set_str(this->b, "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", 16);
mpz_init_set_str(this->q, "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", 16);
Brainpool Curve ID | p | a | b | q |
---|---|---|---|---|
brainpoolP160r1 | E95E4A5F737059DC60DFC7AD95B3D8139515620F | 340E7BE2A280EB74E2BE61BADA745D97E8F7C300 | 1E589A8595423412134FAA2DBDEC95C8D8675E58 | E95E4A5F737059DC60DF5991D45029409E60FC09 |
brainpoolP192r1 | C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297 | 6A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF | 469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9 | C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1 |
brainpoolP224r1 | D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF | 68A5E62CA9CE6C1C299803A6C1530B514E182AD8B0042A59CAD29F43 | 2580F63CCFE44138870713B1A92369E33E2135D266DBB372386C400B | D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F |
brainpoolP256r1 | A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377 | 7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9 | 26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6 | A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7 |
brainpoolP320r1 | D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27 | 3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F492F375A97D860EB4 | 520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD884539816F5EB4AC8FB1F1A6 | D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311 |
brainpoolP384r1 | 8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53 | 7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826 | 04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11 | 8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565 |
brainpoolP512r1 | AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3 | 7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA | 3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723 | AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069 |
The following code is referenced from https://github.com/qiuweixuan/dragonfly_cpp