//
// sub_A4593C from 0xa4593c to 0xa45a68 (300 bytes)
//
// 1 xrefs:
// > ??> @ 0xc8014c
//
// 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:08:15 +0000
//
int __fastcall sub_A4593C(int a1, int a2, int *a3, int a4, int a5)
{
_DWORD *v5; // r6
int result; // r0
int v10; // r2
int v11; // r3
unsigned __int8 *v12; // r4
int v13; // r5
unsigned __int8 *v14; // r12
void *v15; // r0
void *v16; // r0
int v17; // [sp+1Ch] [bp-4h]
v5 = *(_DWORD **)(a1 + 20);
if ( v5[4] != 4 )
{
result = RSA_private_decrypt(a5, a4, a2, *(_DWORD *)(*(_DWORD *)(a1 + 8) + 20));
LABEL_3:
if ( result >= 0 )
{
*a3 = result;
return 1;
}
return result;
}
v10 = v5[8];
if ( !v10 )
{
v17 = a4;
v15 = (void *)EVP_PKEY_size(*(_DWORD *)(a1 + 8));
v16 = CRYPTO_malloc(v15, (int)"crypto/rsa/rsa_pmeth.c", 91);
v5[8] = v16;
if ( !v16 )
return -1;
v10 = (int)v16;
a4 = v17;
}
result = RSA_private_decrypt(a5, a4, v10, *(_DWORD *)(*(_DWORD *)(a1 + 8) + 20));
if ( result > 0 )
{
v11 = 0;
v12 = (unsigned __int8 *)v5[8];
while ( 1 )
{
v13 = *v12;
v14 = v12++;
if ( v13 )
break;
if ( ++v11 == result )
{
v14 = (unsigned __int8 *)(v5[8] + v11);
break;
}
}
result = RSA_padding_check_PKCS1_OAEP_mgf1(a2, result, v14, result - v11, result, v5[9], v5[10], v5[5], v5[6]);
goto LABEL_3;
}
return result;
}