Updated changelog

This commit is contained in:
WolverinDEV 2019-07-07 18:32:07 +02:00
parent 741aeacead
commit 0fbff778c2
1 changed files with 3 additions and 5 deletions

View File

@ -108,7 +108,7 @@ void _fe_neg(fe h, const fe f) {
h[9] = h9;
}
inline std::string keyMul(const uint8_t* publicKey /* compressed */, const uint8_t* privateKey /* uncompressed */, bool negate){
inline void keyMul(uint8_t* target_buffer, const uint8_t* publicKey /* compressed */, const uint8_t* privateKey /* uncompressed */, bool negate){
ge_p3 keyA{};
ge_p2 result{};
@ -119,9 +119,7 @@ inline std::string keyMul(const uint8_t* publicKey /* compressed */, const uint8
}
ge_scalarmult_vartime(&result, privateKey, &keyA);
char buffer[32];
ge_tobytes((uint8_t*) buffer, &result);
return string(buffer, 32);
ge_tobytes(target_buffer, &result);
}
bool CryptionHandler::setupSharedSecretNew(const std::string &alpha, const std::string &beta, const char* privateKey /* uncompressed */, const char* publicKey /* compressed */) {
@ -132,7 +130,7 @@ bool CryptionHandler::setupSharedSecretNew(const std::string &alpha, const std::
string sharedIv;
shared.resize(32, '\0');
sharedIv.resize(64, '\0');
shared = keyMul(reinterpret_cast<const uint8_t *>(publicKey), reinterpret_cast<const uint8_t *>(privateKey), true); //Remote key get negated
keyMul((uint8_t*) shared.data(), reinterpret_cast<const uint8_t *>(publicKey), reinterpret_cast<const uint8_t *>(privateKey), true); //Remote key get negated
sharedIv = digest::sha512(shared);
auto xor_key = alpha + beta;