From 6fd4ec54cc16e95ff9b48adf656c926a1ad7fecb Mon Sep 17 00:00:00 2001 From: Diavolo Date: Wed, 21 Jun 2023 22:12:38 +0200 Subject: [PATCH] fix(utils): fix RSA function --- src/Utils/Cryptography.cpp | 4 +--- src/Utils/Cryptography.hpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Utils/Cryptography.cpp b/src/Utils/Cryptography.cpp index 180aceb7..d07525ff 100644 --- a/src/Utils/Cryptography.cpp +++ b/src/Utils/Cryptography.cpp @@ -109,15 +109,13 @@ namespace Utils const auto hash = SHA512::Compute(message); - register_prng(&sprng_desc); - const ltc_hash_descriptor& hash_desc = sha512_desc; const int hash_index = register_hash(&hash_desc); ltc_mp = ltm_desc; rsa_sign_hash_ex(reinterpret_cast(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(buffer), length }; } diff --git a/src/Utils/Cryptography.hpp b/src/Utils/Cryptography.hpp index ab0ac3df..ec837130 100644 --- a/src/Utils/Cryptography.hpp +++ b/src/Utils/Cryptography.hpp @@ -285,7 +285,7 @@ namespace Utils return std::string{}; } - void deserialize(const std::string& pubKeyBuffer) + void set(const std::string& pubKeyBuffer) { this->free();