//
// SRP_Calc_B from 0xa4b664 to 0xa4b7a0 (316 bytes)
//
// 2 xrefs:
// > SSL_srp_server_param_with_username @ 0x9ca4a0
// > ??> @ 0x7755c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:08:20 +0000
//
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_A4B2E0(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;
}