//
// BN_security_bits from 0x7d4524 to 0x7d45ac (136 bytes)
//
// 4 xrefs:
// > DH_security_bits @ 0x7e0838
// > DSA_security_bits @ 0x7e21e8
// > RSA_security_bits @ 0x82db28
// > ??> @ 0x5fb1c
//
// 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_security_bits(int a1, int a2)
{
int result; // r0
int v3; // r1
if ( a1 >= 15360 )
{
result = 256;
LABEL_6:
if ( a2 == -1 )
return result;
goto LABEL_7;
}
if ( a1 > 7689 )
{
result = 192;
if ( a2 == -1 )
return result;
goto LABEL_7;
}
if ( a1 < 3072 )
{
if ( a1 >= 2048 )
{
result = 112;
}
else
{
if ( a1 < 1024 )
return 0;
result = 80;
}
goto LABEL_6;
}
result = 128;
if ( a2 == -1 )
return result;
LABEL_7:
v3 = a2 / 2;
if ( v3 <= 79 )
return 0;
if ( result >= v3 )
return v3;
return result;
}