//
// SRP_Calc_A from 0x836d7c to 0x836e18 (156 bytes)
//
// 2 xrefs:
// > SRP_Calc_A_param @ 0x7b5e18
// > ??> @ 0x5dbbc
//
// 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 SRP_Calc_A(int a1, int a2, int a3)
{
bool v3; // zf
int v4; // r3
int v8; // r8
int v9; // r0
int v10; // r4
v3 = a3 == 0;
if ( a3 )
v3 = a2 == 0;
v4 = v3;
if ( !a1 )
v4 |= 1u;
if ( v4 )
return 0;
v8 = BN_CTX_new(a1);
if ( !v8 )
return 0;
v9 = BN_new();
v10 = v9;
if ( v9 )
{
if ( !BN_mod_exp(v9, a3, a1, a2, v8) )
{
BN_free(v10);
v10 = 0;
}
}
BN_CTX_free(v8);
return v10;
}