//
// EC_POINT_point2oct from 0x7ed300 to 0x7ed40c (268 bytes)
//
// 6 xrefs:
// > i2o_ECPublicKey @ 0x7e7c5c
// > i2o_ECPublicKey @ 0x7e7c98
// > i2o_ECPublicKey @ 0x7e7cf4
// > EC_POINT_point2buf @ 0x7ed54c
// > EC_POINT_point2buf @ 0x7ed59c
// > ??> @ 0x6153c
//
// 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_POINT_point2oct(int a1, _DWORD *a2)
{
_DWORD *v2; // r12
v2 = *(_DWORD **)a1;
if ( *(_DWORD *)(*(_DWORD *)a1 + 84) )
{
if ( v2 != (_DWORD *)*a2 )
goto LABEL_3;
if ( (*v2 & 1) == 0 )
return (*(int (__fastcall **)(int))(*(_DWORD *)a1 + 84))(a1);
}
else
{
if ( (*v2 & 1) == 0 )
{
ERR_put_error(16, 123, 66, "crypto/ec/ec_oct.c", 93);
return 0;
}
if ( v2 != (_DWORD *)*a2 )
{
LABEL_3:
ERR_put_error(16, 123, 101, "crypto/ec/ec_oct.c", 97);
return 0;
}
}
if ( v2[1] == 406 )
return ec_GFp_simple_point2oct();
else
return ec_GF2m_simple_point2oct();
}