//
// Poly1305_Update from 0x829d84 to 0x829e40 (188 bytes)
//
// 8 xrefs:
// > sub_7FF11C @ 0x7ff1a0
// > sub_7FF11C @ 0x7ff24c
// > sub_7FF11C @ 0x7ff2b0
// > sub_7FF11C @ 0x7ff3d8
// > sub_7FF11C @ 0x7ff3f0
// > sub_7FF11C @ 0x7ff408
// > sub_7FF11C @ 0x7ff41c
// > ??> @ 0x630ec
//
// 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
//
_DWORD *__fastcall Poly1305_Update(_DWORD *result, char *a2, size_t a3)
{
int v3; // r6
int v4; // r5
int (__fastcall *v5)(int, int, int, int); // r9
char *v6; // r7
size_t v7; // r4
int v8; // r8
char *v9; // r0
size_t v10; // r6
unsigned int v11; // r4
v3 = result[56];
v4 = (int)result;
v5 = (int (__fastcall *)(int, int, int, int))result[57];
v6 = a2;
v7 = a3;
if ( v3 )
{
v8 = 16 - v3;
v9 = (char *)result + v3 + 208;
if ( a3 < 16 - v3 )
{
result = memcpy(v9, a2, a3);
*(_DWORD *)(v4 + 224) = v7 + v3;
return result;
}
memcpy(v9, a2, 16 - v3);
v6 += v8;
v7 -= v8;
result = (_DWORD *)v5(v4, v4 + 208, 16, 1);
}
v10 = v7 & 0xF;
v11 = v7 - v10;
if ( v11 > 0xF )
{
result = (_DWORD *)v5(v4, (int)v6, v11, 1);
v6 += v11;
}
if ( v10 )
{
result = memcpy((void *)(v4 + 208), v6, v10);
*(_DWORD *)(v4 + 224) = v10;
}
else
{
*(_DWORD *)(v4 + 224) = 0;
}
return result;
}