//
// sub_DA7208 from 0xda7208 to 0xda72cc (196 bytes)
//
// 10 xrefs:
// > ??> @ 0x11248e0
// > ??> @ 0x1124938
// > ??> @ 0x1124990
// > ??> @ 0x11249e8
// > ??> @ 0x1124a40
// > ??> @ 0x1124a98
// > ??> @ 0x1124af0
// > ??> @ 0x1124b48
// > ??> @ 0x1124ba0
// > ??> @ 0x1124bf8
//
// 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_DA7208(__int64 a1, int a2, __int64 a3, unsigned __int8 *a4)
{
unsigned int v6; // w0
__int64 v7; // x0
unsigned int v8; // w20
__int64 v10; // x0
if ( a2 != 6 )
return (unsigned int)-1;
v6 = EVP_CIPHER_CTX_key_length(a1);
if ( (int)RAND_bytes(a4, v6) <= 0 )
return 0;
DES_set_odd_parity(a4);
if ( (int)EVP_CIPHER_CTX_key_length(a1) > 15 )
{
DES_set_odd_parity(a4 + 8);
v10 = a1;
v8 = 1;
if ( (int)EVP_CIPHER_CTX_key_length(v10) <= 23 )
return v8;
}
else
{
v7 = a1;
v8 = 1;
if ( (int)EVP_CIPHER_CTX_key_length(v7) <= 23 )
return v8;
}
DES_set_odd_parity(a4 + 16);
return 1;
}