//
// sub_DA4D80 from 0xda4d80 to 0xda4e68 (232 bytes)
//
// 21 xrefs:
// > ??> @ 0x1124120
// > ??> @ 0x1124178
// > ??> @ 0x11241d0
// > ??> @ 0x1124228
// > ??> @ 0x1124280
// > ??> @ 0x11242d8
// > ??> @ 0x1124330
// > ??> @ 0x1124388
// > ??> @ 0x11243e0
// > ??> @ 0x1124438
// > ??> @ 0x1124490
// > ??> @ 0x11244e8
// > ??> @ 0x1124540
// > ??> @ 0x1124598
// > ??> @ 0x11245f0
// > ??> @ 0x1124648
// > ??> @ 0x11246a0
// > ??> @ 0x11246f8
// > ??> @ 0x1124750
// > ??> @ 0x11247a8
// > ??> @ 0x1124800
//
// 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_DA4D80(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 cipher_data; // x19
int v8; // w0
__int64 v9; // x0
int v10; // w1
__int64 (__fastcall *v11)(); // x0
cipher_data = EVP_CIPHER_CTX_get_cipher_data(a1);
v8 = EVP_CIPHER_CTX_key_length(a1);
if ( (Camellia_set_key(a2, (unsigned int)(8 * v8), cipher_data) & 0x80000000) == 0 )
{
v9 = EVP_CIPHER_CTX_cipher(a1);
v10 = EVP_CIPHER_flags(v9) & 0xF0007;
if ( (unsigned int)(v10 - 1) > 1 || a4 )
{
*(_QWORD *)(cipher_data + 280) = Camellia_encrypt;
if ( v10 != 2 )
goto LABEL_5;
}
else
{
*(_QWORD *)(cipher_data + 280) = Camellia_decrypt;
if ( v10 != 2 )
{
LABEL_5:
v11 = nullptr;
LABEL_6:
*(_QWORD *)(cipher_data + 288) = v11;
return 1;
}
}
v11 = Camellia_cbc_encrypt;
goto LABEL_6;
}
ERR_put_error(6, 159, 157, (__int64)"crypto/evp/e_camellia.c", 221);
return 0;
}