//
// ec_key_simple_priv2oct from 0xd907a4 to 0xd90858 (180 bytes)
//
// 5 xrefs:
// > ??> @ 0xab888
// > ??> @ 0x1222230
// > ??> @ 0x12223b0
// > ??> @ 0x1222530
// > ??> @ 0x1227270
//
// 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_key_simple_priv2oct(__int64 a1, char *a2, unsigned __int64 a3)
{
int v4; // w0
int v5; // w3
_QWORD *v6; // x4
int v7; // w5
__int64 v8; // x19
__int64 result; // x0
bool v10; // zf
v4 = EC_GROUP_order_bits(*(_QWORD *)(a1 + 24));
v5 = v4 + 7;
if ( v4 + 7 < 0 )
v5 = v4 + 14;
v6 = *(_QWORD **)(a1 + 40);
v7 = v5 >> 3;
v8 = v5 >> 3;
if ( !v6 )
return 0;
if ( !a2 )
return v7;
result = 0;
if ( v7 <= a3 )
{
v10 = (unsigned int)BN_bn2binpad(v6, a2, v7) == -1;
result = v8;
if ( v10 )
{
ERR_put_error(16, 260, 100, "crypto/ec/ec_key.c", 578);
return 0;
}
}
return result;
}