//
// HMAC from 0x80911c to 0x8091ec (208 bytes)
//
// 2 xrefs:
// > sub_80B57C @ 0x80b5d0
// > ??> @ 0x63fdc
//
// 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
//
void *__fastcall HMAC(int a1, const void *a2, size_t a3, int a4, int a5, void *a6, _DWORD *a7)
{
void *v7; // r4
int v11; // r0
_DWORD *v12; // r5
bool v13; // zf
v7 = a6;
if ( !a6 )
v7 = &unk_AD43F4;
v11 = HMAC_CTX_new();
v12 = (_DWORD *)v11;
if ( !v11 )
goto LABEL_12;
v13 = a2 == nullptr;
if ( !a2 )
v13 = a3 == 0;
if ( v13 )
a2 = &unk_A12898;
if ( HMAC_Init_ex(v11, a2, a3, a1, nullptr) && HMAC_Update(v12) && HMAC_Final((int)v12, (int)v7, a7) )
{
HMAC_CTX_free((int)v12);
return v7;
}
else
{
LABEL_12:
HMAC_CTX_free((int)v12);
return nullptr;
}
}