//
// sub_E2BA58 from 0xe2ba58 to 0xe2bc70 (536 bytes)
//
// 1 xrefs:
// > ??> @ 0x1132ec8
//
// 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 sub_E2BA58(__int64 a1, int a2, int a3, unsigned int *a4)
{
__int64 v4; // x19
v4 = *(_QWORD *)(a1 + 40);
if ( a2 == 11 )
return 1;
if ( a2 <= 11 )
{
if ( a2 == 2 )
{
ERR_put_error(10, 120, 150, (__int64)"crypto/dsa/dsa_pmeth.c", 167);
return 4294967294LL;
}
if ( a2 <= 2 )
{
if ( a2 == 1 )
{
if ( (unsigned int)EVP_MD_type(a4) != 64
&& (unsigned int)EVP_MD_type(a4) != 116
&& (unsigned int)EVP_MD_type(a4) != 66
&& (unsigned int)EVP_MD_type(a4) != 675
&& (unsigned int)EVP_MD_type(a4) != 672
&& (unsigned int)EVP_MD_type(a4) != 673
&& (unsigned int)EVP_MD_type(a4) != 674 )
{
ERR_put_error(10, 120, 106, (__int64)"crypto/dsa/dsa_pmeth.c", 150);
return 0;
}
goto LABEL_31;
}
return 4294967294LL;
}
if ( a2 != 5 && a2 != 7 )
return 4294967294LL;
return 1;
}
if ( a2 == 4097 )
{
if ( a3 > 255 )
{
*(_DWORD *)v4 = a3;
return 1;
}
return 4294967294LL;
}
if ( a2 > 4097 )
{
if ( a2 == 4098 )
{
if ( (a3 & 0xFFFFFFBF) == 0xA0 || (a3 & 0xFFFFFEFF) == 0 )
{
*(_DWORD *)(v4 + 4) = a3;
return 1;
}
}
else if ( a2 == 4099 )
{
if ( (unsigned int)EVP_MD_type(a4) != 64
&& (unsigned int)EVP_MD_type(a4) != 675
&& (unsigned int)EVP_MD_type(a4) != 672 )
{
ERR_put_error(10, 120, 106, (__int64)"crypto/dsa/dsa_pmeth.c", 136);
return 0;
}
LABEL_31:
*(_QWORD *)(v4 + 24) = a4;
return 1;
}
return 4294967294LL;
}
if ( a2 != 13 )
return 4294967294LL;
*(_QWORD *)a4 = *(_QWORD *)(v4 + 24);
return 1;
}