//
// SRP_Calc_B from 0x836a64 to 0x836ba0 (316 bytes)
//
// 2 xrefs:
// > SSL_srp_server_param_with_username @ 0x7b589c
// > ??> @ 0x5dadc
//
// 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_B(int a1, int *a2, int *a3, int a4)
{
bool v4; // zf
bool v5; // zf
int v10; // r10
_BYTE *v11; // r11
_BYTE *v12; // r9
int v13; // r4
int *v14; // r5
v4 = a2 == nullptr;
if ( a2 )
v4 = a1 == 0;
if ( v4 )
return 0;
v5 = a4 == 0;
if ( a4 )
v5 = a3 == nullptr;
if ( v5 )
return 0;
v10 = BN_CTX_new(a1);
if ( v10 )
{
v11 = (_BYTE *)BN_new();
if ( v11 && (v12 = (_BYTE *)BN_new()) != nullptr )
{
v13 = BN_new();
if ( v13 )
{
if ( BN_mod_exp(v12, a3, a1, a2, v10) && (v14 = sub_8366E0(a2, a3, a2)) != nullptr )
{
if ( BN_mod_mul(v11, a4, v14, a2, v10) && BN_mod_add(v13, v12, v11, a2, v10) )
goto LABEL_16;
}
else
{
v14 = nullptr;
}
BN_free(v13);
v13 = 0;
}
else
{
v14 = nullptr;
}
}
else
{
v14 = nullptr;
v13 = 0;
v12 = nullptr;
}
LABEL_16:
BN_CTX_free(v10);
BN_clear_free(v11);
BN_clear_free(v12);
BN_free((int)v14);
return v13;
}
return 0;
}