diff --git a/src/key.cpp b/src/key.cpp index 1ab4c62..8263977 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -5,6 +5,7 @@ #include #include #include +#include "Gost.h" // i2pd #include "key.h" @@ -129,9 +130,12 @@ private: EC_KEY *pkey; public: - CECKey() { - pkey = EC_KEY_new_by_curve_name(NID_secp256k1); - assert(pkey != NULL); + CECKey() + { + pkey = EC_KEY_new (); + // GOST 34.10-2012 + auto ret = EC_KEY_set_group(pkey, i2p::crypto::GetGOSTR3410Curve (i2p::crypto::eGOSTR3410CryptoProA)->GetGroup ()); + assert (ret == 1); } ~CECKey() { diff --git a/src/key.h b/src/key.h index ce469ad..4f7bd70 100644 --- a/src/key.h +++ b/src/key.h @@ -12,7 +12,7 @@ #include "uint256.h" #include "hash.h" -// secp256k1: +// GOST R 34.10-2012 // const unsigned int PRIVATE_KEY_SIZE = 279; // const unsigned int PUBLIC_KEY_SIZE = 65; // const unsigned int SIGNATURE_SIZE = 72;