Why divide modulo Range? Modulo the Order is probably correct, it gives a different result. And then cut off the 32-bit string.
I found an error again
unsigned char derivedKey[64]; // SHA-512 produces a 64-byte key
if (PKCS5_PBKDF2_HMAC((const char*)BN_bn2hex(minKey), BN_num_bytes(minKey), salt, sizeof(salt), 0, EVP_sha512(), sizeof(derivedKey), derivedKey) != 1) {
// Handle error
return nullptr;
}
****************************************************************************************
int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
const unsigned char *salt, int saltlen, int iter,
const EVP_MD *digest,
int keylen, unsigned char *out);
****************************************************************************************
passlen
salt = "Bitcoin seed"; // Salt is always constant !
iter = 1 // Didn't look at the code? 0 gives 1 intervention? or 2048 intervention?
// in VanitySearch version function 0 gives 1 iteration.
keylen = 64
-------------------------------------------------------------------------------------------
Where is the Input data