Browse Source

replaced P256 by GOST 34.10

pull/5/head
orignal 7 years ago
parent
commit
01256fe89d
  1. 10
      src/key.cpp
  2. 2
      src/key.h

10
src/key.cpp

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
#include <openssl/ecdsa.h>
#include <openssl/rand.h>
#include <openssl/obj_mac.h>
#include "Gost.h" // i2pd
#include "key.h"
@ -129,9 +130,12 @@ private: @@ -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() {

2
src/key.h

@ -12,7 +12,7 @@ @@ -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;

Loading…
Cancel
Save