//
// sub_1025568 from 0x1025568 to 0x102562c (196 bytes)
//
// 10 xrefs:
// > ??> @ 0x1401e70
// > ??> @ 0x1401ec8
// > ??> @ 0x1401f20
// > ??> @ 0x1401f78
// > ??> @ 0x1401fd0
// > ??> @ 0x1402028
// > ??> @ 0x1402080
// > ??> @ 0x14020d8
// > ??> @ 0x1402130
// > ??> @ 0x1402188
//
// 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 13:16:13 +0000
//
__int64 __fastcall sub_1025568(__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;
}