//
// BN_security_bits from 0xd7a614 to 0xd7a6a0 (140 bytes)
//
// 5 xrefs:
// > DH_security_bits @ 0xd88080
// > DH_security_bits @ 0xd880a8
// > DSA_security_bits @ 0xd89a74
// > RSA_security_bits @ 0xdd409c
// > ??> @ 0x61728
//
// 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
//
__int64 __fastcall BN_security_bits(int a1, int a2)
{
unsigned int v2; // w3
__int64 result; // x0
int v4; // w2
bool v5; // zf
bool v6; // nf
bool v7; // vf
if ( a1 > 15359 )
{
v2 = 256;
}
else
{
if ( a1 > 7689 )
{
v2 = 192;
if ( a2 == -1 )
return v2;
goto LABEL_8;
}
if ( a1 > 3071 )
{
v2 = 128;
}
else if ( a1 > 2047 )
{
v2 = 112;
}
else
{
v7 = __OFSUB__(a1, 1023);
v5 = a1 == 1023;
v6 = a1 - 1023 < 0;
result = 0;
if ( v6 ^ v7 | v5 )
return result;
v2 = 80;
}
}
if ( a2 == -1 )
return v2;
LABEL_8:
result = 0;
v4 = a2 / 2;
if ( a2 / 2 > 79 )
{
if ( (int)v2 > v4 )
return (unsigned int)v4;
else
return v2;
}
return result;
}