//
// RSA_padding_check_X931 from 0xa4712c to 0xa47288 (348 bytes)
//
// 2 xrefs:
// > sub_A42E10 @ 0xa43168
// > ??> @ 0x7fe5c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:08:16 +0000
//
int __fastcall RSA_padding_check_X931(void *a1, int a2, unsigned __int8 *a3, int a4, int a5)
{
int v5; // r3
unsigned __int8 *v6; // r1
size_t v7; // r4
int v9; // r3
int v10; // r12
int v11; // r4
int v12; // r2
int v13; // r12
int v14; // t1
bool v15; // zf
if ( a5 != a4 || (v5 = *a3, (unsigned int)(v5 - 106) > 1) )
{
ERR_put_error(4, 128, 137, (int)"crypto/rsa/rsa_x931.c", 61);
return -1;
}
if ( v5 == 107 )
{
v9 = a5 - 3;
if ( a5 - 3 <= 0 )
goto LABEL_18;
v10 = a3[1];
v6 = a3 + 2;
if ( v10 == 186 )
goto LABEL_18;
if ( v10 != 187 )
{
LABEL_20:
ERR_put_error(4, 128, 138, (int)"crypto/rsa/rsa_x931.c", 72);
return -1;
}
v11 = a5 - 3;
v12 = 0;
while ( ++v12 != v9 )
{
v14 = *v6++;
v13 = v14;
if ( v14 == 186 )
{
v11 = v12;
break;
}
if ( v13 != 187 )
goto LABEL_20;
}
v15 = v11 == 0;
v7 = v9 - v11;
if ( v15 )
{
LABEL_18:
ERR_put_error(4, 128, 138, (int)"crypto/rsa/rsa_x931.c", 80);
return -1;
}
}
else
{
v6 = a3 + 1;
v7 = a5 - 2;
}
if ( v6[v7] == 204 )
{
memcpy(a1, v6, v7);
return v7;
}
else
{
ERR_put_error(4, 128, 139, (int)"crypto/rsa/rsa_x931.c", 88);
return -1;
}
}