//
// BN_BLINDING_new from 0xe15118 to 0xe15244 (300 bytes)
//
// 2 xrefs:
// > BN_BLINDING_create_param @ 0xe153b8
// > ??> @ 0xbb590
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
_QWORD *__fastcall BN_BLINDING_new(__int64 a1, __int64 a2, __int64 a3)
{
_QWORD *v6; // x19
pthread_rwlock_t *v7; // x0
unsigned __int64 *v8; // x0
unsigned __int64 *v9; // x0
unsigned __int64 *v10; // x0
_QWORD *result; // x0
v6 = CRYPTO_zalloc(off_50, (__int64)"crypto/bn/bn_blind.c", 36);
if ( v6 )
{
v7 = CRYPTO_THREAD_lock_new();
v6[9] = v7;
if ( v7 )
{
BN_BLINDING_set_current_thread((__int64)v6);
if ( (!a1 || (v8 = BN_dup(a1), (*v6 = v8) != 0))
&& (!a2 || (v9 = BN_dup(a2), (v6[1] = v9) != 0))
&& (v10 = BN_dup(a3), (v6[3] = v10) != 0) )
{
if ( (unsigned int)BN_get_flags(a3, 4u) )
BN_set_flags(v6[3], 4);
result = v6;
*((_DWORD *)v6 + 10) = -1;
}
else
{
BN_BLINDING_free((__int64)v6);
return nullptr;
}
}
else
{
ERR_put_error(3, 102, 65, (__int64)"crypto/bn/bn_blind.c", 43);
CRYPTO_free(v6, (__int64)"crypto/bn/bn_blind.c", 44);
return nullptr;
}
}
else
{
ERR_put_error(3, 102, 65, (__int64)"crypto/bn/bn_blind.c", 37);
return nullptr;
}
return result;
}