//
// DH_compute_key_padded from 0x7e03dc to 0x7e0448 (108 bytes)
//
// 2 xrefs:
// > sub_87FAD8 @ 0x87fb94
// > ??> @ 0x60abc
//
// 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
//
int __fastcall DH_compute_key_padded(char *a1, int a2, int a3)
{
int v5; // r0
size_t v6; // r5
int v7; // r4
int v8; // r0
int v9; // r4
v5 = (*(int (**)(void))(*(_DWORD *)(a3 + 64) + 8))();
v6 = v5;
if ( v5 <= 0 )
return v5;
v8 = BN_num_bits(*(_DWORD **)(a3 + 8));
v9 = v8 + 7;
if ( v8 + 7 < 0 )
v9 = v8 + 14;
v7 = v9 >> 3;
if ( (int)(v7 - v6) > 0 )
{
memmove(&a1[v7 - v6], a1, v6);
memset(a1, 0, v7 - v6);
}
return v7;
}