//
// sub_A123F4 from 0xa123f4 to 0xa124a4 (176 bytes)
//
// 3 xrefs:
// > ??> @ 0xc787e8
// > ??> @ 0xc7881c
// > ??> @ 0xc78850
//
// 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:47 +0000
//
int __fastcall sub_A123F4(int a1, int a2, const void *a3)
{
int cipher_data; // r0
bool v7; // zf
int v8; // r8
_DWORD *v9; // r4
int v10; // r0
void *v11; // r0
cipher_data = EVP_CIPHER_CTX_get_cipher_data(a1);
v7 = a3 == nullptr;
if ( !a3 )
v7 = a2 == 0;
v8 = v7;
if ( !v7 )
{
v9 = (_DWORD *)cipher_data;
if ( a2 )
{
v10 = EVP_CIPHER_CTX_key_length(a1);
AES_set_encrypt_key(a2, 8 * v10, v9);
CRYPTO_ccm128_init(v9 + 70, v9[67], v9[66], v9, AES_encrypt);
v9[82] = v8;
v9[62] = 1;
}
if ( a3 )
{
v11 = (void *)EVP_CIPHER_CTX_iv_noconst(a1);
memcpy(v11, a3, 15 - v9[66]);
v9[63] = 1;
}
}
return 1;
}