In C++, I am trying to convert an array of int representing a big integer to a BIGNUM using the OpenSSL library.
It's OK with an string containing the hexadecimal encoding of the big number, but I can't find how to do it with an array.
#include <openssl/bn.h>
int main()
{
uint32_t hash[4] = { 0x3506fa7d, 0x6bb2dbe9, 0x9041d8e5, 0x6ea31f6b };
const char p_hash[] = "3506fa7d6bb2dbe99041d8e56ea31f6b";
BIGNUM *bn_result1 = BN_new();
BN_hex2bn(&bn_result1, p_hash);
std::cout << "Big number as Dec: " << BN_bn2dec(bn_result1) << std::endl;
std::cout << "Big number as Hex: " << BN_bn2hex(bn_result1) << std::endl;
// How to convert hash[4] to BIGNUM bn_result2?
}