//
// ec_key_simple_priv2oct from 0x100eb04 to 0x100ebb8 (180 bytes)
//
// 5 xrefs:
// > ??> @ 0xe0c20
// > ??> @ 0x1539fb8
// > ??> @ 0x153a138
// > ??> @ 0x153a2b8
// > ??> @ 0x153eff8
//
// 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:01 +0000
//
__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;
}