//
// sub_D9BBDC from 0xd9bbdc to 0xd9bd14 (312 bytes)
//
// 1 xrefs:
// > ??> @ 0x1123288
//
// 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 sub_D9BBDC(__int64 a1, __int64 a2)
{
__int64 v3; // x19
__int64 v4; // x0
v3 = CRYPTO_zalloc(40, "crypto/ec/ecx_meth.c", 58);
if ( v3 )
{
v4 = CRYPTO_secure_malloc(32, "crypto/ec/ecx_meth.c", 67);
*(_QWORD *)(v3 + 32) = v4;
if ( v4 )
{
if ( (int)RAND_bytes(v4, 32) <= 0 )
{
CRYPTO_secure_free(*(_QWORD *)(v3 + 32), "crypto/ec/ecx_meth.c", 75);
CRYPTO_free(v3, "crypto/ec/ecx_meth.c", 76);
return 0;
}
else
{
**(_BYTE **)(v3 + 32) &= 0xF8u;
*(_BYTE *)(*(_QWORD *)(v3 + 32) + 31LL) &= ~0x80u;
*(_BYTE *)(*(_QWORD *)(v3 + 32) + 31LL) |= 0x40u;
X25519_public_from_private(v3, *(_QWORD *)(v3 + 32));
EVP_PKEY_assign(a2, 1034, v3);
return 1;
}
}
else
{
ERR_put_error(16, 266, 65, "crypto/ec/ecx_meth.c", 69);
CRYPTO_free(v3, "crypto/ec/ecx_meth.c", 70);
return 0;
}
}
else
{
ERR_put_error(16, 266, 65, "crypto/ec/ecx_meth.c", 60);
return 0;
}
}