//
// sub_80088C from 0x80088c to 0x800924 (152 bytes)
//
// 10 xrefs:
// > ??> @ 0xa31c68
// > ??> @ 0xa31c9c
// > ??> @ 0xa31cd0
// > ??> @ 0xa31d04
// > ??> @ 0xa31d38
// > ??> @ 0xa31d6c
// > ??> @ 0xa31da0
// > ??> @ 0xa31dd4
// > ??> @ 0xa31e08
// > ??> @ 0xa31e3c
//
// 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
//
int __fastcall sub_80088C(int a1, int a2, int a3, unsigned __int8 *a4)
{
int v6; // r0
if ( a2 != 6 )
return -1;
v6 = EVP_CIPHER_CTX_key_length(a1);
if ( RAND_bytes(a4, v6) <= 0 )
return 0;
DES_set_odd_parity(a4);
if ( EVP_CIPHER_CTX_key_length(a1) > 15 )
{
DES_set_odd_parity(a4 + 8);
if ( EVP_CIPHER_CTX_key_length(a1) <= 23 )
return 1;
}
else if ( EVP_CIPHER_CTX_key_length(a1) <= 23 )
{
return 1;
}
DES_set_odd_parity(a4 + 16);
return 1;
}