//
// EVP_PKEY_keygen from 0xa1b7b8 to 0xa1b8b0 (248 bytes)
//
// 5 xrefs:
// > ssl_generate_pkey @ 0x9a3c50
// > ssl_generate_pkey_curve @ 0x9a3d18
// > EVP_PKEY_new_mac_key @ 0xa1b970
// > cms_RecipientInfo_kari_init @ 0xa896f8
// > ??> @ 0x748bc
//
// 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_keygen(_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 + 32)) == nullptr )
{
ERR_put_error(6, 146, 150, (int)"crypto/evp/pmeth_gn.c", 91);
return -2;
}
if ( a1[4] != 4 )
{
ERR_put_error(6, 146, 151, (int)"crypto/evp/pmeth_gn.c", 95);
return -1;
}
if ( !a2 )
return -1;
if ( *a2 )
{
result = v3(a1);
goto LABEL_8;
}
v7 = EVP_PKEY_new();
*a2 = (int)v7;
if ( !v7 )
return -1;
result = (*(int (__fastcall **)(_DWORD *))(*a1 + 32))(a1);
LABEL_8:
v6 = result;
if ( result <= 0 )
{
EVP_PKEY_free(*a2);
*a2 = 0;
return v6;
}
return result;
}