//
// BN_BLINDING_convert_ex from 0x86be30 to 0x86bf00 (208 bytes)
//
// 6 xrefs:
// > sub_82E968 @ 0x82ecb4
// > sub_82E968 @ 0x82ecf4
// > sub_82EE80 @ 0x82f0d8
// > sub_82EE80 @ 0x82f108
// > BN_BLINDING_convert @ 0x86bf10
// > ??> @ 0x6648c
//
// 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
//
int __fastcall BN_BLINDING_convert_ex(int a1, int a2, int *a3, int a4)
{
int v6; // r3
bool v8; // zf
int result; // r0
_BOOL4 v11; // r5
if ( !*a3 || !a3[1] )
{
ERR_put_error(3, 100, 107, (int)"crypto/bn/bn_blind.c", 137);
return 0;
}
v6 = a3[5];
v8 = v6 == -1;
if ( v6 == -1 )
v6 = 0;
if ( v8 )
{
a3[5] = v6;
}
else
{
result = BN_BLINDING_update(a3, a4);
if ( !result )
return result;
}
if ( a2 )
v11 = BN_copy(a2, a3[1]) != 0;
else
v11 = 1;
return BN_mod_mul(a1, a1, *a3, a3[3], a4) && v11;
}