//
// ec_GF2m_simple_is_on_curve from 0x88a210 to 0x88a37c (364 bytes)
//
// 2 xrefs:
// > ??> @ 0x6aa0c
// > ??> @ 0xab4fd8
//
// 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_is_on_curve(_DWORD *a1, _DWORD *a2, int ***a3)
{
int (__fastcall *v7)(_DWORD *, int, int, _DWORD, int ***); // r9
int (__fastcall *v8)(_DWORD *, int **, _DWORD, int ***); // r10
void **v9; // r6
int **v10; // r11
int **v11; // r0
int v12; // r8
int is_zero; // r5
void **v14; // r0
if ( EC_POINT_is_at_infinity((int)a1, a2) )
return 1;
v7 = *(int (__fastcall **)(_DWORD *, int, int, _DWORD, int ***))(*a1 + 136);
v8 = *(int (__fastcall **)(_DWORD *, int **, _DWORD, int ***))(*a1 + 140);
if ( !a2[4] )
return -1;
if ( a3 )
{
v9 = nullptr;
goto LABEL_7;
}
v14 = (void **)BN_CTX_new();
v9 = v14;
if ( !v14 )
return -1;
a3 = (int ***)v14;
LABEL_7:
BN_CTX_start((int)a3);
v10 = BN_CTX_get(a3);
v11 = BN_CTX_get(a3);
v12 = (int)v11;
if ( v11
&& BN_GF2m_add(v11, a2[1], a1[16])
&& v7(a1, v12, v12, a2[1], a3)
&& BN_GF2m_add(v12, v12, a2[2])
&& v7(a1, v12, v12, a2[1], a3)
&& BN_GF2m_add(v12, v12, a1[17])
&& v8(a1, v10, a2[2], a3)
&& BN_GF2m_add(v12, v12, v10) )
{
is_zero = BN_is_zero(v12);
}
else
{
is_zero = -1;
}
BN_CTX_end(a3);
BN_CTX_free(v9);
return is_zero;
}