//
// sub_A0A67C from 0xa0a67c to 0xa0a7b0 (308 bytes)
//
// 1 xrefs:
// > ??> @ 0xc781d0
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:42 +0000
//
int __fastcall sub_A0A67C(int a1, int a2)
{
int v3; // r4
int v4; // r0
v3 = CRYPTO_zalloc(36, "crypto/ec/ecx_meth.c", 58);
if ( v3 )
{
v4 = CRYPTO_secure_malloc(32, "crypto/ec/ecx_meth.c", 67);
*(_DWORD *)(v3 + 32) = v4;
if ( v4 )
{
if ( RAND_bytes(v4, 32) <= 0 )
{
CRYPTO_secure_free(*(_DWORD *)(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 *)(*(_DWORD *)(v3 + 32) + 31) &= ~0x80u;
*(_BYTE *)(*(_DWORD *)(v3 + 32) + 31) |= 0x40u;
X25519_public_from_private(v3, *(_DWORD *)(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;
}
}