//
// EVP_PKEY_decrypt from 0xdad424 to 0xdad534 (272 bytes)
//
// 6 xrefs:
// > tls_process_client_key_exchange @ 0xd531bc
// > sub_DCC148 @ 0xdcc1cc
// > sub_DCC148 @ 0xdcc210
// > CMS_RecipientInfo_decrypt @ 0xe1e1d8
// > CMS_RecipientInfo_decrypt @ 0xe1e218
// > ??> @ 0x8a4b0
//
// 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 EVP_PKEY_decrypt(__int64 *a1, __int64 a2, _QWORD *a3)
{
__int64 v4; // x5
__int64 (__fastcall *v5)(__int64 *); // x0
int v6; // w0
if ( a1 && (v4 = *a1) != 0 && (v5 = *(__int64 (__fastcall **)(__int64 *))(v4 + 168)) != nullptr )
{
if ( *((_DWORD *)a1 + 8) == 512 )
{
if ( (*(_DWORD *)(v4 + 4) & 2) != 0 )
{
v6 = EVP_PKEY_size(a1[2]);
if ( a2 )
{
if ( (unsigned __int64)v6 > *a3 )
{
ERR_put_error(6, 104, 155, (__int64)"crypto/evp/pmeth_fn.c", 198);
return 0;
}
else
{
return (*(__int64 (__fastcall **)(__int64 *))(*a1 + 168))(a1);
}
}
else
{
*a3 = v6;
return 1;
}
}
else
{
return v5(a1);
}
}
else
{
ERR_put_error(6, 104, 151, (__int64)"crypto/evp/pmeth_fn.c", 195);
return 0xFFFFFFFFLL;
}
}
else
{
ERR_put_error(6, 104, 150, (__int64)"crypto/evp/pmeth_fn.c", 191);
return 4294967294LL;
}
}