//
// ec_precompute_mont_data from 0x1010a2c to 0x1010ae4 (184 bytes)
//
// 2 xrefs:
// > EC_GROUP_set_generator @ 0x1010bb0
// > ??> @ 0x100648
//
// 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:16:02 +0000
//
__int64 __fastcall ec_precompute_mont_data(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v4; // x20
__int64 v5; // x0
v4 = BN_CTX_new(a1, a2, a3);
BN_MONT_CTX_free(*(_QWORD *)(a1 + 144));
*(_QWORD *)(a1 + 144) = 0;
if ( v4 && (v5 = BN_MONT_CTX_new(), (*(_QWORD *)(a1 + 144) = v5) != 0) )
{
if ( BN_MONT_CTX_set(v5, *(_QWORD ***)(a1 + 16), v4) )
{
BN_CTX_free(v4);
return 1;
}
else
{
BN_MONT_CTX_free(*(_QWORD *)(a1 + 144));
*(_QWORD *)(a1 + 144) = 0;
BN_CTX_free(v4);
return 0;
}
}
else
{
BN_CTX_free(v4);
return 0;
}
}