//
// CMS_RecipientInfo_kari_set0_pkey from 0xa893ec to 0xa89450 (100 bytes)
//
// 1 xrefs:
// > ??> @ 0x83e0c
//
// 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:08:53 +0000
//
int __fastcall CMS_RecipientInfo_kari_set0_pkey(int a1, int a2)
{
int v2; // r4
int *v4; // r0
int v5; // r5
v2 = *(_DWORD *)(a1 + 4);
EVP_PKEY_CTX_free(*(_DWORD *)(v2 + 20));
*(_DWORD *)(v2 + 20) = 0;
if ( !a2 )
return 1;
v4 = (int *)EVP_PKEY_CTX_new(a2, nullptr);
v5 = (int)v4;
if ( v4 && EVP_PKEY_derive_init(v4) )
{
*(_DWORD *)(v2 + 20) = v5;
return 1;
}
else
{
EVP_PKEY_CTX_free(v5);
return 0;
}
}