//
// ec_key_simple_oct2priv from 0xd908c0 to 0xd90974 (180 bytes)
//
// 5 xrefs:
// > ??> @ 0x82290
// > ??> @ 0x1222238
// > ??> @ 0x12223b8
// > ??> @ 0x1222538
// > ??> @ 0x1227278
//
// 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_oct2priv(__int64 a1, _BYTE *a2, int a3)
{
__int64 v3; // x19
unsigned __int64 *v5; // x19
__int64 result; // x0
__int64 v7; // x0
int v8; // [xsp+20h] [xbp+20h]
_BYTE *v9; // [xsp+28h] [xbp+28h]
v3 = *(_QWORD *)(a1 + 40);
if ( v3 || (v8 = a3, v9 = a2, v7 = BN_secure_new(), *(_QWORD *)(a1 + 40) = v7, v3 = v7, a2 = v9, a3 = v8, v7) )
{
v5 = BN_bin2bn(a2, a3, v3);
*(_QWORD *)(a1 + 40) = v5;
result = 1;
if ( !v5 )
{
ERR_put_error(16, 259, 3, "crypto/ec/ec_key.c", 606);
return 0;
}
}
else
{
ERR_put_error(16, 259, 65, "crypto/ec/ec_key.c", 601);
return 0;
}
return result;
}