2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-04-21 10:58:44 +00:00

chore: use libtomcrypt rsa_verify_hash_v2 as old method was deprecated

This commit is contained in:
Jan Laupetin
2026-04-19 21:26:34 +01:00
parent 487887dc1e
commit 535f0e299c

View File

@@ -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<unsigned long>(signatureSize),
signedData,
static_cast<unsigned long>(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<unsigned long>(signatureSize), signedData, static_cast<unsigned long>(signedDataSize), &params, &result, &m_key);
return result == 1;
}