//
// ec_precompute_mont_data from 0xa004e0 to 0xa0055c (124 bytes)
//
// 2 xrefs:
// > EC_GROUP_set_generator @ 0xa0062c
// > ??> @ 0x7b5ec
//
// 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:07:38 +0000
//
int __fastcall ec_precompute_mont_data(int a1)
{
int v2; // r5
_DWORD *v3; // r0
int v4; // r6
v2 = BN_CTX_new();
BN_MONT_CTX_free(*(_BYTE **)(a1 + 88));
*(_DWORD *)(a1 + 88) = 0;
if ( v2 && (v3 = BN_MONT_CTX_new(), (*(_DWORD *)(a1 + 88) = v3) != 0) )
{
if ( BN_MONT_CTX_set((int)v3, *(int ***)(a1 + 8), v2) )
{
v4 = 1;
}
else
{
BN_MONT_CTX_free(*(_BYTE **)(a1 + 88));
v4 = 0;
*(_DWORD *)(a1 + 88) = 0;
}
}
else
{
v4 = 0;
}
BN_CTX_free(v2);
return v4;
}