//
// sub_7F57E8 from 0x7f57e8 to 0x7f5914 (300 bytes)
//
// 1 xrefs:
// > ??> @ 0xa30ff8
//
// 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 sub_7F57E8(int a1, int a2, int a3, int *a4)
{
int result; // r0
int v7; // r0
int v8; // r2
void *v9; // r0
void *v10; // r4
switch ( a2 )
{
case 9:
v8 = a3 != 32;
if ( !a4 )
v8 |= 1u;
if ( v8 )
{
ERR_put_error(16, 266, 102, "crypto/ec/ecx_meth.c", 53);
return 0;
}
else
{
v9 = (void *)CRYPTO_zalloc(36, "crypto/ec/ecx_meth.c", 58);
v10 = v9;
if ( v9 )
{
memcpy(v9, a4, 0x20u);
EVP_PKEY_assign(a1, 1034, v10);
return 1;
}
else
{
ERR_put_error(16, 266, 65, "crypto/ec/ecx_meth.c", 60);
return 0;
}
}
case 10:
result = *(_DWORD *)(a1 + 20);
if ( result )
{
v7 = CRYPTO_memdup(result, 32, "crypto/ec/ecx_meth.c", 281);
*a4 = v7;
if ( v7 )
return 32;
else
return 0;
}
break;
case 3:
*a4 = 672;
return 2;
default:
return -2;
}
return result;
}