//
// EC_KEY_priv2buf from 0x7e9a34 to 0x7e9ab4 (128 bytes)
//
// 4 xrefs:
// > sub_7E5364 @ 0x7e544c
// > EC_KEY_print @ 0x7e56d8
// > i2d_ECPrivateKey @ 0x7e7730
// > ??> @ 0x6121c
//
// 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_KEY_priv2buf(int a1, int *a2)
{
int v4; // r0
int result; // r0
int v6; // r7
v4 = EC_KEY_priv2oct(a1);
if ( !v4 )
return 0;
v6 = CRYPTO_malloc(v4, "crypto/ec/ec_key.c", 619);
if ( !v6 )
return 0;
result = EC_KEY_priv2oct(a1);
if ( result )
{
*a2 = v6;
}
else
{
CRYPTO_free(v6, "crypto/ec/ec_key.c", 624);
return 0;
}
return result;
}