//
// RSA_padding_check_PKCS1_type_1 from 0xdd58d4 to 0xdd5a64 (400 bytes)
//
// 2 xrefs:
// > sub_DD47A4 @ 0xdd4b30
// > ??> @ 0x6a248
//
// 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 RSA_padding_check_PKCS1_type_1(void *a1, signed int a2, _BYTE *a3, int a4, int a5)
{
unsigned __int8 *v5; // x4
int v6; // w3
int v7; // w5
int v8; // w2
const void *v10; // x4
unsigned int v11; // w19
int v13; // w2
if ( a5 <= 10 )
return 0xFFFFFFFFLL;
if ( a5 == a4 )
{
if ( *a3++ )
{
ERR_put_error(4, 112, 138, (__int64)"crypto/rsa/rsa_pk1.c", 67);
return 0xFFFFFFFFLL;
}
a4 = a5 - 1;
}
if ( a4 + 1 != a5 || (v5 = a3 + 1, *a3 != 1) )
{
ERR_put_error(4, 112, 106, (__int64)"crypto/rsa/rsa_pk1.c", 75);
return 0xFFFFFFFFLL;
}
v6 = a4 - 1;
if ( v6 <= 0 )
{
if ( v6 )
goto LABEL_19;
LABEL_10:
ERR_put_error(4, 112, 113, (__int64)"crypto/rsa/rsa_pk1.c", 97);
return 0xFFFFFFFFLL;
}
v7 = (unsigned __int8)a3[1];
v8 = 0;
if ( v7 == 255 )
{
while ( 1 )
{
++v8;
++v5;
if ( v8 == v6 )
goto LABEL_10;
v7 = *v5;
if ( v7 != 255 )
goto LABEL_11;
}
}
v8 = 0;
LABEL_11:
if ( !v7 )
{
v10 = v5 + 1;
if ( v8 > 7 )
{
v11 = v6 - (v8 + 1);
if ( (int)v11 <= a2 )
{
memcpy(a1, v10, v11);
return v11;
}
v13 = 109;
goto LABEL_20;
}
LABEL_19:
v13 = 103;
LABEL_20:
ERR_put_error(4, 112, v13, (__int64)"crypto/rsa/rsa_pk1.c", v13);
return 0xFFFFFFFFLL;
}
ERR_put_error(4, 112, 102, (__int64)"crypto/rsa/rsa_pk1.c", 88);
return 0xFFFFFFFFLL;
}