//
// DH_compute_key_padded from 0xd87bdc to 0xd87c84 (168 bytes)
//
// 2 xrefs:
// > sub_E29D70 @ 0xe29e3c
// > ??> @ 0x31788
//
// 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 DH_compute_key_padded(char *a1, __int64 a2, __int64 a3)
{
__int64 result; // x0
int v6; // w19
int v7; // w0
int v8; // w3
int v9; // w0
unsigned int v10; // w20
int v11; // w2
size_t v12; // x21
LODWORD(result) = (*(__int64 (**)(void))(*(_QWORD *)(a3 + 120) + 16LL))();
v6 = result;
if ( (int)result <= 0 )
return (unsigned int)result;
v7 = BN_num_bits(*(_QWORD *)(a3 + 8));
v8 = v7 + 14;
v9 = v7 + 7;
if ( v9 >= 0 )
v8 = v9;
v10 = v8 >> 3;
v11 = (v8 >> 3) - v6;
if ( v11 > 0 )
{
v12 = v11;
memmove(&a1[v11], a1, v6);
memset(a1, 0, v12);
}
return v10;
}