//
// ec_GF2m_simple_group_check_discriminant from 0xa9e738 to 0xa9e7ec (180 bytes)
//
// 2 xrefs:
// > ??> @ 0x843ac
// > ??> @ 0xd19670
//
// 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:09:11 +0000
//
bool __fastcall ec_GF2m_simple_group_check_discriminant(int a1, int ***a2)
{
int ***v2; // r4
void **v4; // r6
int **v5; // r0
int v6; // r7
_BOOL4 v7; // r5
int ***v9; // r0
v2 = a2;
if ( a2 )
{
v4 = nullptr;
}
else
{
v9 = (int ***)BN_CTX_new();
v2 = v9;
if ( !v9 )
{
v4 = nullptr;
ERR_put_error(16, 159, 65, (int)"crypto/ec/ec2_smpl.c", 259);
v7 = 0;
goto LABEL_8;
}
v4 = (void **)v9;
}
BN_CTX_start((int)v2);
v5 = BN_CTX_get(v2);
v6 = (int)v5;
v7 = v5 && BN_GF2m_mod_arr(v5, *(_DWORD *)(a1 + 68), a1 + 40) && !BN_is_zero(v6);
BN_CTX_end(v2);
LABEL_8:
BN_CTX_free(v4);
return v7;
}