//
// sub_A1548C from 0xa1548c to 0xa15524 (152 bytes)
//
// 10 xrefs:
// > ??> @ 0xc78ee8
// > ??> @ 0xc78f1c
// > ??> @ 0xc78f50
// > ??> @ 0xc78f84
// > ??> @ 0xc78fb8
// > ??> @ 0xc78fec
// > ??> @ 0xc79020
// > ??> @ 0xc79054
// > ??> @ 0xc79088
// > ??> @ 0xc790bc
//
// 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:48 +0000
//
int __fastcall sub_A1548C(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;
}