//
// BN_security_bits from 0xff8974 to 0xff8a00 (140 bytes)
//
// 5 xrefs:
// > DH_security_bits @ 0x10063e0
// > DH_security_bits @ 0x1006408
// > DSA_security_bits @ 0x1007dd4
// > RSA_security_bits @ 0x10523fc
// > ??> @ 0x84fe8
//
// 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:15:49 +0000
//
__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;
}