//
// EVP_CIPHER_CTX_set_key_length from 0x80341c to 0x8034a4 (136 bytes)
//
// 5 xrefs:
// > CMAC_Init @ 0x7d91e4
// > sub_8011CC @ 0x8012c4
// > PKCS7_dataDecode @ 0x827760
// > cms_EncryptedContent_init_bio @ 0x8cf504
// > ??> @ 0x6008c
//
// 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 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;
}
}