//
// RSA_padding_check_X931 from 0xdd8ee8 to 0xdd903c (340 bytes)
//
// 2 xrefs:
// > sub_DD47A4 @ 0xdd4af4
// > ??> @ 0x3eca0
//
// 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_X931(void *a1, __int64 a2, unsigned __int8 *a3, int a4, int a5)
{
int v5; // w3
unsigned __int8 *v6; // x1
unsigned int v7; // w19
int v9; // w4
int v10; // w3
int v11; // w5
int v12; // w2
int v13; // w3
int v14; // t1
if ( a5 != a4 || (v5 = *a3, (unsigned __int8)(v5 - 106) > 1u) )
{
ERR_put_error(4, 128, 137, (__int64)"crypto/rsa/rsa_x931.c", 61);
return 0xFFFFFFFFLL;
}
if ( v5 == 107 )
{
v9 = a5 - 3;
if ( v9 <= 0 )
goto LABEL_15;
v10 = a3[1];
v6 = a3 + 2;
if ( v10 == 186 )
goto LABEL_15;
v11 = v9;
v12 = 0;
if ( v10 != 187 )
{
LABEL_17:
ERR_put_error(4, 128, 138, (__int64)"crypto/rsa/rsa_x931.c", 72);
return 0xFFFFFFFFLL;
}
while ( ++v12 != v9 )
{
v14 = *v6++;
v13 = v14;
if ( v14 == 186 )
{
v11 = v12;
break;
}
if ( v13 != 187 )
goto LABEL_17;
}
v7 = v9 - v11;
if ( !v11 )
{
LABEL_15:
ERR_put_error(4, 128, 138, (__int64)"crypto/rsa/rsa_x931.c", 80);
return 0xFFFFFFFFLL;
}
}
else
{
v6 = a3 + 1;
v7 = a5 - 2;
}
if ( v6[v7] == 204 )
{
memcpy(a1, v6, v7);
return v7;
}
else
{
ERR_put_error(4, 128, 139, (__int64)"crypto/rsa/rsa_x931.c", 88);
return 0xFFFFFFFFLL;
}
}