diff --git a/src/Cryptography/Algorithms/AlgorithmRsa.cpp b/src/Cryptography/Algorithms/AlgorithmRsa.cpp index 450fdf71..50059f41 100644 --- a/src/Cryptography/Algorithms/AlgorithmRsa.cpp +++ b/src/Cryptography/Algorithms/AlgorithmRsa.cpp @@ -1,6 +1,7 @@ #include "AlgorithmRsa.h" #include "Internal/CryptoLibrary.h" +#include "tomcrypt_private.h" using namespace cryptography; @@ -29,15 +30,21 @@ namespace const int padding = GetPaddingMode(); int result; - rsa_verify_hash_ex(signature, - static_cast(signatureSize), - signedData, - static_cast(signedDataSize), - padding, - hashId, - 8, - &result, - &m_key); + const ltc_rsa_parameters rsaParams{ + .saltlen = 8, + .hash_idx = hashId, + .mgf1_hash_idx = hashId, + }; + ltc_rsa_op_parameters params{ + .params = rsaParams, + .padding = padding, + .wprng = -1, + .prng = nullptr, + .u = {}, + }; + + rsa_verify_hash_v2( + signature, static_cast(signatureSize), signedData, static_cast(signedDataSize), ¶ms, &result, &m_key); return result == 1; } diff --git a/thirdparty/libtomcrypt b/thirdparty/libtomcrypt index 3223b875..2e441a17 160000 --- a/thirdparty/libtomcrypt +++ b/thirdparty/libtomcrypt @@ -1 +1 @@ -Subproject commit 3223b87588dee9eb2ed6c7bfd7e01ffae0a607f2 +Subproject commit 2e441a17df132db9a0acaefdfaaa73a734fba8e7