//
// EC_GROUP_new from 0x100f2c0 to 0x100f3f4 (308 bytes)
//
// 7 xrefs:
// > EC_GROUP_new_by_curve_name @ 0x100d504
// > EC_GROUP_new_by_curve_name @ 0x100d568
// > EC_GROUP_new_curve_GFp @ 0x100dc38
// > EC_GROUP_new_curve_GF2m @ 0x100dcac
// > EC_KEY_copy @ 0x100ded0
// > EC_GROUP_dup @ 0x100fd90
// > ??> @ 0x104788
//
// 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:16:01 +0000
//
__int64 __fastcall EC_GROUP_new(int *a1)
{
__int64 v2; // x19
int v3; // w0
unsigned int (__fastcall *v4)(__int64); // x1
__int64 v6; // x0
__int64 v7; // x0
if ( !a1 )
{
ERR_put_error(16, 108, 108, "crypto/ec/ec_lib.c", 30);
return 0;
}
if ( !*((_QWORD *)a1 + 1) )
{
ERR_put_error(16, 108, 66, "crypto/ec/ec_lib.c", 34);
return 0;
}
v2 = CRYPTO_zalloc(168, "crypto/ec/ec_lib.c", 38);
if ( !v2 )
{
ERR_put_error(16, 108, 65, "crypto/ec/ec_lib.c", 40);
return 0;
}
v3 = *a1;
*(_QWORD *)v2 = a1;
if ( (v3 & 2) == 0 )
{
v6 = BN_new();
*(_QWORD *)(v2 + 16) = v6;
if ( !v6 )
{
LABEL_11:
BN_free(v6);
BN_free(*(_QWORD *)(v2 + 24));
CRYPTO_free(v2, "crypto/ec/ec_lib.c", 62);
return 0;
}
v7 = BN_new();
*(_QWORD *)(v2 + 24) = v7;
if ( !v7 )
goto LABEL_10;
}
v4 = *((unsigned int (__fastcall **)(__int64))a1 + 1);
*(_DWORD *)(v2 + 36) = 1;
*(_DWORD *)(v2 + 40) = 4;
if ( !v4(v2) )
{
LABEL_10:
v6 = *(_QWORD *)(v2 + 16);
goto LABEL_11;
}
return v2;
}