From a21fb17d7378fb1d42aaf60aaafeb935f81ae37f Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 13 Nov 2017 11:50:17 -0500 Subject: [PATCH] renamed ECIES-P256 --- libi2pd/Crypto.cpp | 4 ++-- libi2pd/Identity.cpp | 3 +++ libi2pd/Identity.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libi2pd/Crypto.cpp b/libi2pd/Crypto.cpp index ddd42f0d..a9f63dc7 100644 --- a/libi2pd/Crypto.cpp +++ b/libi2pd/Crypto.cpp @@ -447,13 +447,13 @@ namespace crypto memcpy (data, m + 33, 222); else { - LogPrint (eLogError, "ECICS decrypt hash doesn't match"); + LogPrint (eLogError, "ECIES decrypt hash doesn't match"); ret = false; } } else { - LogPrint (eLogError, "ECICS decrypt point is invalid"); + LogPrint (eLogError, "ECIES decrypt point is invalid"); ret = false; } diff --git a/libi2pd/Identity.cpp b/libi2pd/Identity.cpp index 6d207dd5..7c4f777d 100644 --- a/libi2pd/Identity.cpp +++ b/libi2pd/Identity.cpp @@ -451,6 +451,7 @@ namespace data return std::make_shared(key); break; case CRYPTO_KEY_TYPE_ECIES_P256_SHA256_AES256CBC: + case CRYPTO_KEY_TYPE_ECIES_P256_SHA256_AES256CBC_TEST: return std::make_shared(key); break; case CRYPTO_KEY_TYPE_ECIES_GOSTR3410_CRYPTO_PRO_A_SHA256_AES256CBC: @@ -602,6 +603,7 @@ namespace data return std::make_shared(key); break; case CRYPTO_KEY_TYPE_ECIES_P256_SHA256_AES256CBC: + case CRYPTO_KEY_TYPE_ECIES_P256_SHA256_AES256CBC_TEST: return std::make_shared(key); break; case CRYPTO_KEY_TYPE_ECIES_GOSTR3410_CRYPTO_PRO_A_SHA256_AES256CBC: @@ -673,6 +675,7 @@ namespace data i2p::crypto::GenerateElGamalKeyPair(priv, pub); break; case CRYPTO_KEY_TYPE_ECIES_P256_SHA256_AES256CBC: + case CRYPTO_KEY_TYPE_ECIES_P256_SHA256_AES256CBC_TEST: i2p::crypto::CreateECIESP256RandomKeys (priv, pub); break; case CRYPTO_KEY_TYPE_ECIES_GOSTR3410_CRYPTO_PRO_A_SHA256_AES256CBC: diff --git a/libi2pd/Identity.h b/libi2pd/Identity.h index b0c6f48a..0495b490 100644 --- a/libi2pd/Identity.h +++ b/libi2pd/Identity.h @@ -53,7 +53,8 @@ namespace data const size_t DEFAULT_IDENTITY_SIZE = sizeof (Identity); // 387 bytes const uint16_t CRYPTO_KEY_TYPE_ELGAMAL = 0; - const uint16_t CRYPTO_KEY_TYPE_ECIES_P256_SHA256_AES256CBC = 65280; // TODO: change to actual code + const uint16_t CRYPTO_KEY_TYPE_ECIES_P256_SHA256_AES256CBC = 1; + const uint16_t CRYPTO_KEY_TYPE_ECIES_P256_SHA256_AES256CBC_TEST = 65280; // TODO: remove later const uint16_t CRYPTO_KEY_TYPE_ECIES_GOSTR3410_CRYPTO_PRO_A_SHA256_AES256CBC = 65281; // TODO: use GOST R 34.11 instead SHA256 and GOST 28147-89 instead AES const uint16_t SIGNING_KEY_TYPE_DSA_SHA1 = 0;