//
// EVP_PKEY_paramgen from 0xa1b604 to 0xa1b728 (292 bytes)
//
// 2 xrefs:
// > tls_process_key_exchange @ 0x9b7fb4
// > ??> @ 0x76c8c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:52 +0000
//
int __fastcall EVP_PKEY_paramgen(_DWORD *a1, int *a2)
{
int (__fastcall *v3)(_DWORD *); // r3
int result; // r0
int v6; // r4
_DWORD *v7; // r1
if ( !a1 || !*a1 || (v3 = *(int (__fastcall **)(_DWORD *))(*a1 + 24)) == nullptr )
{
ERR_put_error(6, 148, 150, (int)"crypto/evp/pmeth_gn.c", 40);
return -2;
}
if ( a1[4] != 2 )
{
ERR_put_error(6, 148, 151, (int)"crypto/evp/pmeth_gn.c", 45);
return -1;
}
if ( !a2 )
return -1;
if ( *a2 )
{
result = v3(a1);
}
else
{
v7 = EVP_PKEY_new();
*a2 = (int)v7;
if ( !v7 )
{
ERR_put_error(6, 148, 65, (int)"crypto/evp/pmeth_gn.c", 56);
return -1;
}
result = (*(int (__fastcall **)(_DWORD *))(*a1 + 24))(a1);
}
v6 = result;
if ( result <= 0 )
{
EVP_PKEY_free(*a2);
*a2 = 0;
return v6;
}
return result;
}