//
// SRP_Calc_B from 0x105c9c0 to 0x105cb18 (344 bytes)
//
// 2 xrefs:
// > SSL_srp_server_param_with_username @ 0xfda95c
// > ??> @ 0x5ed68
//
// 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:16:48 +0000
//
__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_105C620(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;
}