//
// SRP_create_verifier from 0xde01a0 to 0xde04cc (812 bytes)
//
// 1 xrefs:
// > ??> @ 0x2e8a8
//
// 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
//
const char *__fastcall SRP_create_verifier(
const char *a1,
const char *a2,
unsigned __int64 *a3,
_QWORD *a4,
char *a5,
char *a6)
{
int v11; // w1
unsigned __int64 *v12; // x23
__int64 v13; // d8
int v14; // w1
__int64 v15; // d9
const char *v16; // x23
unsigned __int64 *v17; // x0
unsigned __int64 v18; // x20
__int64 v19; // x21
int v20; // w1
unsigned __int64 *v21; // x0
__int64 v22; // x5
int v23; // w0
bool v24; // nf
int v25; // w4
int v26; // w0
_BYTE *v27; // x22
int v28; // w0
int v29; // w2
char **default_gN; // x0
unsigned __int64 *v32; // x0
_BYTE *v33; // x0
unsigned __int64 *v34; // [xsp+88h] [xbp+88h]
_BYTE *v35; // [xsp+88h] [xbp+88h]
unsigned __int64 *v36; // [xsp+90h] [xbp+90h] BYREF
_BYTE *v37; // [xsp+98h] [xbp+98h] BYREF
unsigned __int8 v38[912]; // [xsp+A0h] [xbp+A0h] BYREF
unsigned __int8 v39[2504]; // [xsp+A68h] [xbp+A68h] BYREF
v36 = nullptr;
v37 = nullptr;
if ( !a1 || !a2 || !a3 || !a4 )
goto LABEL_20;
if ( a5 )
{
v11 = sub_DDEFF8(v38, a5);
if ( v11 > 0 )
{
v12 = BN_bin2bn(v38, v11, 0);
v13 = (__int64)v12;
v14 = sub_DDEFF8(v38, a6);
if ( v14 <= 0 )
{
v18 = 0;
v15 = (__int64)v12;
v19 = 0;
v27 = nullptr;
v16 = nullptr;
goto LABEL_19;
}
v15 = (__int64)v12;
v16 = "*";
v17 = BN_bin2bn(v38, v14, 0);
v18 = *a3;
v34 = v17;
v19 = (__int64)v17;
if ( *a3 )
goto LABEL_9;
LABEL_25:
if ( (int)RAND_bytes((__int64)v39, 20) <= 0 )
goto LABEL_22;
v32 = BN_bin2bn(v39, 20, v18);
v22 = (__int64)v34;
v36 = v32;
goto LABEL_11;
}
LABEL_20:
v18 = 0;
v19 = 0;
v27 = nullptr;
v15 = 0;
v16 = nullptr;
goto LABEL_19;
}
default_gN = SRP_get_default_gN(a6);
if ( !default_gN )
goto LABEL_20;
v19 = 0;
v18 = *a3;
v34 = (unsigned __int64 *)default_gN[1];
v13 = (__int64)default_gN[2];
v16 = *default_gN;
v15 = 0;
if ( !*a3 )
goto LABEL_25;
LABEL_9:
v20 = sub_DDEFF8(v39, (char *)v18);
if ( v20 <= 0 )
{
LABEL_21:
v18 = 0;
LABEL_22:
v27 = (_BYTE *)v18;
v16 = (const char *)v18;
goto LABEL_19;
}
v21 = BN_bin2bn(v39, v20, 0);
v22 = (__int64)v34;
v36 = v21;
LABEL_11:
if ( !(unsigned int)SRP_create_verifier_BN(a1, a2, &v36, (__int64 *)&v37, v13, v22) )
goto LABEL_21;
BN_bn2bin(v37, v38);
v23 = BN_num_bits((__int64)v37);
v25 = v23 + 7;
v24 = v23 + 7 < 0;
v26 = v23 + 14;
if ( v24 )
v25 = v26;
v18 = 2 * (v25 >> 3);
v27 = CRYPTO_malloc((void *)v18, (__int64)"crypto/srp/srp_vfy.c", 594);
if ( v27 )
{
v28 = BN_num_bits((__int64)v37);
v29 = v28 + 14;
if ( v28 + 7 >= 0 )
v29 = v28 + 7;
sub_DDEE5C(v27, v38, v29 >> 3);
if ( !*a3 )
{
v33 = CRYPTO_malloc(&qword_28, (__int64)"crypto/srp/srp_vfy.c", 601);
if ( !v33 )
{
v16 = nullptr;
goto LABEL_19;
}
v35 = v33;
sub_DDEE5C(v33, v39, 20);
*a3 = (unsigned __int64)v35;
}
*a4 = v27;
v27 = nullptr;
}
else
{
v16 = nullptr;
}
LABEL_19:
BN_free(v15);
BN_free(v19);
CRYPTO_clear_free(v27, v18, (__int64)"crypto/srp/srp_vfy.c", 0x267u);
BN_clear_free(v36);
BN_clear_free(v37);
return v16;
}