//
// sub_10070A034 from 0x10070a034 to 0x10070a15c (296 bytes)
//
// 3 xrefs:
// > sub_10070A024 @ 0x10070a02c
// > sub_10070A380 @ 0x10070a380
// > sub_10072417C @ 0x1007244d8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 11:12:53 +0000
//
__int64 __fastcall sub_10070A034(__int64 *a1, __int64 a2, _DWORD *a3, int a4, int a5, int a6, int a7, int a8)
{
__int64 v11; // x8
__int64 v12; // x22
int v13; // w0
__int64 result; // x0
__int64 v15; // x8
v11 = *a1;
if ( (*(_BYTE *)(*a1 + 18) & 0x10) != 0 )
{
v13 = (*(__int64 (__fastcall **)(__int64 *, __int64, _QWORD, _QWORD))(v11 + 32))(a1, a2, 0, 0);
if ( v13 < 0 )
{
return 0;
}
else
{
*a3 = v13;
return 1;
}
}
else
{
v12 = *(unsigned int *)(v11 + 4);
if ( (unsigned int)v12 >= 0x21 )
sub_1006AE64C((char)"evp_enc.c", 403, (int)"b <= sizeof ctx->buf", a4, a5, a6, a7, a8);
if ( (_DWORD)v12 == 1 )
{
LABEL_16:
*a3 = 0;
return 1;
}
v15 = *((unsigned int *)a1 + 5);
if ( (*((_BYTE *)a1 + 113) & 1) != 0 )
{
if ( (_DWORD)v15 )
{
sub_100706FB0(6, 127, 138, (__int64)"evp_enc.c", 412);
return 0;
}
goto LABEL_16;
}
if ( (unsigned int)v12 > (unsigned int)v15 )
memset((char *)a1 + v15 + 56, v12 - v15, (unsigned int)(v12 - 1 - v15) + 1LL);
result = (*(__int64 (__fastcall **)(__int64 *, __int64, __int64 *, __int64))(*a1 + 32))(a1, a2, a1 + 7, v12);
if ( (_DWORD)result )
*a3 = v12;
else
return 0;
}
return result;
}