//
// BN_BLINDING_new from 0x1093418 to 0x1093544 (300 bytes)
//
// 2 xrefs:
// > BN_BLINDING_create_param @ 0x10936b8
// > ??> @ 0xf4558
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:17:22 +0000
//
_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;
}