//
// ec_precompute_mont_data from 0xd926cc to 0xd92784 (184 bytes)
//
// 2 xrefs:
// > EC_GROUP_set_generator @ 0xd92850
// > ??> @ 0xc50d0
//
// 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
//
__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;
}
}