//
// SRP_Calc_B from 0xdde680 to 0xdde7d8 (344 bytes)
//
// 2 xrefs:
// > SSL_srp_server_param_with_username @ 0xd5c608
// > ??> @ 0x424e0
//
// 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 SRP_Calc_B(__int64 a1, __int64 *a2, __int64 *a3, __int64 a4)
{
__int64 v8; // x24
_BYTE *v9; // x26
_BYTE *v10; // x25
__int64 v11; // x19
unsigned __int64 *v12; // x21
__int64 v13; // x0
if ( a1 )
{
if ( a2 )
{
if ( a3 )
{
if ( a4 )
{
v8 = BN_CTX_new(a1, a2, a3);
if ( v8 )
{
v9 = (_BYTE *)BN_new();
if ( v9 && (v10 = (_BYTE *)BN_new()) != nullptr )
{
v11 = BN_new();
if ( v11 )
{
if ( (unsigned int)BN_mod_exp(v10, a3, a1, a2, v8) && (v12 = sub_DDE2E0(a2, a3, a2)) != nullptr )
{
if ( (unsigned int)BN_mod_mul(v9, a4, v12, a2, v8) && (unsigned int)BN_mod_add(v11, v10, v9, a2, v8) )
goto LABEL_13;
}
else
{
v12 = nullptr;
}
v13 = v11;
v11 = 0;
BN_free(v13);
}
else
{
v12 = nullptr;
}
}
else
{
v12 = nullptr;
v11 = 0;
v10 = nullptr;
}
LABEL_13:
BN_CTX_free(v8);
BN_clear_free(v9);
BN_clear_free(v10);
BN_free((__int64)v12);
return v11;
}
}
}
}
}
return 0;
}