//
// RSA_padding_add_PKCS1_type_1 from 0x82f3f8 to 0x82f498 (160 bytes)
//
// 2 xrefs:
// > sub_82E968 @ 0x82ebbc
// > ??> @ 0x6645c
//
// 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
//
int __fastcall RSA_padding_add_PKCS1_type_1(_BYTE *a1, int a2, const void *a3, signed int a4)
{
size_t v5; // r4
_BYTE *v7; // r0
if ( a2 - 10 <= a4 )
{
ERR_put_error(4, 108, 110, (int)"crypto/rsa/rsa_pk1.c", 26);
return 0;
}
else
{
v5 = a2 - 3 - a4;
*a1 = 0;
a1[1] = 1;
v7 = memset(a1 + 2, 255, v5);
v7[v5] = 0;
memcpy(&v7[v5 + 1], a3, a4);
return 1;
}
}