//
// DH_set0_key from 0x1006530 to 0x100659c (108 bytes)
//
// 4 xrefs:
// > tls_process_key_exchange @ 0xfca344
// > tls_process_client_key_exchange @ 0xfd1650
// > DSA_dup_DH @ 0x1007eac
// > ??> @ 0xc5410
//
// 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:15:56 +0000
//
__int64 __fastcall DH_set0_key(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v4; // x0
v4 = *(_QWORD *)(a1 + 32);
if ( v4 )
{
if ( !a2 )
goto LABEL_4;
}
else if ( !a2 )
{
return 0;
}
BN_free(v4);
*(_QWORD *)(a1 + 32) = a2;
LABEL_4:
if ( !a3 )
return 1;
BN_free(*(_QWORD *)(a1 + 40));
*(_QWORD *)(a1 + 40) = a3;
return 1;
}