//
// EVP_CIPHER_param_to_asn1 from 0xa18628 to 0xa186e8 (192 bytes)
//
// 8 xrefs:
// > sub_9F3D50 @ 0x9f3f44
// > sub_9F8980 @ 0x9f8cf8
// > PKCS7_dataInit @ 0xa3ba40
// > CMS_add0_recipient_password @ 0xa8ac30
// > PKCS5_pbe2_set_iv @ 0xadc290
// > PKCS5_pbe2_set_scrypt @ 0xadc59c
// > cms_EncryptedContent_init_bio @ 0xae467c
// > ??> @ 0x7a43c
//
// 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_param_to_asn1(int a1, int a2)
{
int v5; // r0
int v6; // r0
int v7; // r2
unsigned int v8; // r3
if ( *(_DWORD *)(*(_DWORD *)a1 + 36) )
return (*(int (__fastcall **)(int))(*(_DWORD *)a1 + 36))(a1);
if ( (*(_DWORD *)(*(_DWORD *)a1 + 16) & 0x1000) == 0 )
return -1;
v5 = EVP_CIPHER_CTX_cipher(a1);
v6 = EVP_CIPHER_flags(v5);
v7 = 65537;
v8 = v6 & 0xF0007;
if ( (v6 & 0xF0007) == 0x10001 )
return -1;
if ( (v6 & 0xF0007u) <= 0x10001 )
{
v8 -= 6;
if ( v8 > 1 )
return EVP_CIPHER_set_asn1_iv(a1, a2, v7, v8);
return -1;
}
if ( v8 != 65538 )
{
v7 = 65539;
if ( v8 != 65539 )
return EVP_CIPHER_set_asn1_iv(a1, a2, v7, v8);
return -1;
}
if ( EVP_CIPHER_CTX_nid(a1) == 246 )
ASN1_TYPE_set(a2, 5, 0);
return 1;
}