//
// EVP_CIPHER_CTX_reset from 0xda8f3c to 0xda8ff0 (180 bytes)
//
// 14 xrefs:
// > ssl3_change_cipher_state @ 0xd5eda4
// > ssl3_change_cipher_state @ 0xd5ee58
// > ssl3_change_cipher_state @ 0xd5ee70
// > tls1_change_cipher_state @ 0xd60eb8
// > tls1_change_cipher_state @ 0xd610f0
// > EVP_CIPHER_CTX_free @ 0xda9014
// > EVP_CipherInit_ex @ 0xda9d90
// > EVP_CipherInit @ 0xdaa154
// > EVP_CIPHER_CTX_copy @ 0xdaa2ac
// > CMS_RecipientInfo_kari_decrypt @ 0xe1f234
// > CMS_RecipientInfo_kari_decrypt @ 0xe1f2b8
// > cms_RecipientInfo_kari_encrypt @ 0xe1f6e8
// > cms_RecipientInfo_kari_encrypt @ 0xe1f790
// > ??> @ 0x54fa8
//
// 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
//
__int64 __fastcall EVP_CIPHER_CTX_reset(__int64 *a1)
{
__int64 (*v2)(void); // x1
__int64 result; // x0
_BYTE *v4; // x0
int v5; // w1
if ( !a1 )
return 1;
if ( !*a1 )
goto LABEL_10;
v2 = *(__int64 (**)(void))(*a1 + 40);
if ( !v2 || (result = v2(), (_DWORD)result) )
{
v4 = (_BYTE *)a1[15];
if ( !v4 )
goto LABEL_7;
v5 = *(_DWORD *)(*a1 + 48);
if ( !v5 )
goto LABEL_7;
OPENSSL_cleanse(v4, v5);
LABEL_10:
v4 = (_BYTE *)a1[15];
LABEL_7:
CRYPTO_free(v4, "crypto/evp/evp_enc.c", 31);
ENGINE_finish(a1[1]);
a1[20] = 0;
*a1 = 0;
a1[1] = 0;
a1[2] = 0;
a1[3] = 0;
a1[4] = 0;
a1[5] = 0;
a1[6] = 0;
a1[7] = 0;
a1[8] = 0;
a1[9] = 0;
a1[10] = 0;
a1[11] = 0;
a1[12] = 0;
a1[13] = 0;
a1[14] = 0;
a1[15] = 0;
a1[16] = 0;
a1[17] = 0;
a1[18] = 0;
a1[19] = 0;
return 1;
}
return result;
}