//
// ec_GF2m_simple_group_set_curve from 0x10b15ac to 0x10b16a8 (252 bytes)
//
// 2 xrefs:
// > ??> @ 0x68ab8
// > ??> @ 0x153eee8
//
// 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:17:43 +0000
//
__int64 __fastcall ec_GF2m_simple_group_set_curve(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
int v8; // w2
int v9; // w1
int v10; // w2
int v11; // w2
int v12; // w1
int v13; // w2
if ( !BN_copy(*(unsigned __int64 **)(a1 + 64), a2) )
return 0;
if ( (BN_GF2m_poly2arr(*(_QWORD *)(a1 + 64), a1 + 72, 6) & 0xFFFFFFFD) != 4 )
{
ERR_put_error(16, 195, 131, (__int64)"crypto/ec/ec2_smpl.c", 180);
return 0;
}
if ( !(unsigned int)BN_GF2m_mod_arr(*(_QWORD *)(a1 + 96), a3, a1 + 72) )
return 0;
v8 = *(_DWORD *)(a1 + 72);
v9 = v8 + 126;
v10 = v8 + 63;
if ( v10 >= 0 )
v9 = v10;
if ( !bn_wexpand(*(unsigned __int64 **)(a1 + 96), v9 >> 6) )
return 0;
bn_set_all_zero(*(_DWORD **)(a1 + 96));
if ( !(unsigned int)BN_GF2m_mod_arr(*(_QWORD *)(a1 + 104), a4, a1 + 72) )
return 0;
v11 = *(_DWORD *)(a1 + 72);
v12 = v11 + 126;
v13 = v11 + 63;
if ( v13 >= 0 )
v12 = v13;
if ( !bn_wexpand(*(unsigned __int64 **)(a1 + 104), v12 >> 6) )
return 0;
bn_set_all_zero(*(_DWORD **)(a1 + 104));
return 1;
}