fix(utils): fix RSA function

This commit is contained in:
Diavolo 2023-06-21 22:12:38 +02:00
parent da34ecbba7
commit 6fd4ec54cc
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
2 changed files with 2 additions and 4 deletions

View File

@ -109,15 +109,13 @@ namespace Utils
const auto hash = SHA512::Compute(message); const auto hash = SHA512::Compute(message);
register_prng(&sprng_desc);
const ltc_hash_descriptor& hash_desc = sha512_desc; const ltc_hash_descriptor& hash_desc = sha512_desc;
const int hash_index = register_hash(&hash_desc); const int hash_index = register_hash(&hash_desc);
ltc_mp = ltm_desc; ltc_mp = ltm_desc;
rsa_sign_hash_ex(reinterpret_cast<const std::uint8_t*>(hash.data()), hash.size(), rsa_sign_hash_ex(reinterpret_cast<const std::uint8_t*>(hash.data()), hash.size(),
buffer, &length, LTC_PKCS_1_V1_5, nullptr, find_prng("sprng"), hash_index, 0, key.getKeyPtr()); buffer, &length, LTC_PKCS_1_V1_5, nullptr, 0, hash_index, 0, key.getKeyPtr());
return std::string{ reinterpret_cast<char*>(buffer), length }; return std::string{ reinterpret_cast<char*>(buffer), length };
} }

View File

@ -285,7 +285,7 @@ namespace Utils
return std::string{}; return std::string{};
} }
void deserialize(const std::string& pubKeyBuffer) void set(const std::string& pubKeyBuffer)
{ {
this->free(); this->free();