//
// EVP_CIPHER_CTX_set_key_length from 0xa1801c to 0xa180a4 (136 bytes)
//
// 5 xrefs:
// > CMAC_Init @ 0x9edde4
// > sub_A15DCC @ 0xa15ec4
// > PKCS7_dataDecode @ 0xa3c360
// > cms_EncryptedContent_init_bio @ 0xae4504
// > ??> @ 0x79b0c
//
// 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:50 +0000
//
int __fastcall EVP_CIPHER_CTX_set_key_length(_DWORD *a1, int a2)
{
int v2; // r2
v2 = *(_DWORD *)(*a1 + 16);
if ( (v2 & 0x80) != 0 )
return EVP_CIPHER_CTX_ctrl((int)a1);
if ( a1[22] == a2 )
return 1;
if ( a2 > 0 && (v2 & 8) != 0 )
{
a1[22] = a2;
return 1;
}
else
{
ERR_put_error(6, 122, 130, (int)"crypto/evp/evp_enc.c", 557);
return 0;
}
}