//
// ec_GF2m_simple_group_set_curve from 0x889a1c to 0x889b18 (252 bytes)
//
// 2 xrefs:
// > ??> @ 0x6a8ec
// > ??> @ 0xab4f84
//
// 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 ec_GF2m_simple_group_set_curve(int *a1, int a2, int a3, int a4)
{
int v8; // r3
int v9; // r1
int v10; // r3
int v11; // r1
if ( !BN_copy(a1[9], a2) )
return 0;
if ( (BN_GF2m_poly2arr(a1[9], a1 + 10, 6) & 0xFFFFFFFD) != 4 )
{
ERR_put_error(16, 195, 131, (int)"crypto/ec/ec2_smpl.c", 180);
return 0;
}
if ( !BN_GF2m_mod_arr(a1[16], a3, a1 + 10) )
return 0;
v8 = a1[10];
v9 = v8 + 31;
if ( v8 + 31 < 0 )
v9 = v8 + 62;
if ( !bn_wexpand(a1[16], v9 >> 5) )
return 0;
bn_set_all_zero((_DWORD *)a1[16]);
if ( !BN_GF2m_mod_arr(a1[17], a4, a1 + 10) )
return 0;
v10 = a1[10];
v11 = v10 + 31;
if ( v10 + 31 < 0 )
v11 = v10 + 62;
if ( !bn_wexpand(a1[17], v11 >> 5) )
return 0;
bn_set_all_zero((_DWORD *)a1[17]);
return 1;
}