//
// sub_1005CCD74 from 0x1005ccd74 to 0x1005cd0cc (856 bytes)
//
// 1 xrefs:
// > ??> @ 0x10083a698
//
// 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 sub_1005CCD74(__int64 a1, char *__s1, char *a3)
{
__int64 v6; // x19
__int64 v7; // x2
__int64 v8; // x4
__int64 v10; // x4
__int64 v11; // x2
__int64 v12; // x3
__int64 v13; // x8
__int64 v14; // x0
__int64 v15; // x5
void *v16; // x20
unsigned int v17; // [xsp+0h] [xbp-30h]
void *v18; // [xsp+8h] [xbp-28h] BYREF
if ( !a3 )
{
v7 = 147;
v8 = 642;
LABEL_11:
sub_1005E0E48(4, 144, v7, "rsa_pmeth.c", v8);
return 0;
}
if ( !strcmp(__s1, "rsa_padding_mode") )
{
if ( !strcmp(a3, "pkcs1") )
{
v10 = 1;
}
else if ( !strcmp(a3, "sslv23") )
{
v10 = 2;
}
else if ( !strcmp(a3, "none") )
{
v10 = 3;
}
else if ( !strcmp(a3, "oeap") )
{
v10 = 4;
}
else if ( !strcmp(a3, "oaep") )
{
v10 = 4;
}
else if ( !strcmp(a3, "x931") )
{
v10 = 5;
}
else
{
if ( strcmp(a3, "pss") )
{
sub_1005E0E48(4, 144, 118, "rsa_pmeth.c", 662);
return 4294967294LL;
}
v10 = 6;
}
v11 = 0xFFFFFFFFLL;
v12 = 4097;
LABEL_45:
v14 = a1;
v15 = 0;
return sub_1005EC7FC(v14, 6, v11, v12, v10, v15);
}
if ( !strcmp(__s1, "rsa_pss_saltlen") )
{
v10 = atoi(a3);
v11 = 24;
v12 = 4098;
goto LABEL_45;
}
if ( !strcmp(__s1, "rsa_keygen_bits") )
{
v10 = atoi(a3);
v11 = 4;
v12 = 4099;
goto LABEL_45;
}
if ( !strcmp(__s1, "rsa_keygen_pubexp") )
{
v18 = nullptr;
if ( !(unsigned int)sub_1005ADB88((__int64 *)&v18, a3) )
return 0;
v6 = sub_1005EC7FC(a1, 6, 4, 4100, 0, v18);
if ( (int)v6 <= 0 )
sub_1005AACD0(v18);
return v6;
}
if ( strcmp(__s1, "rsa_mgf1_md") )
{
if ( strcmp(__s1, "rsa_oaep_md") )
{
if ( strcmp(__s1, "rsa_oaep_label") )
return 4294967294LL;
v16 = (void *)sub_100607904(a3);
if ( !v16 )
return 0;
v6 = sub_1005EC7FC(a1, 6, 768, 4106, v17, v16);
if ( (int)v6 <= 0 )
sub_100588C44(v16);
return v6;
}
v13 = sub_1005E8060(a3);
if ( v13 )
{
v11 = 768;
v12 = 4105;
goto LABEL_33;
}
v7 = 160;
v8 = 703;
goto LABEL_11;
}
v13 = sub_1005E8060(a3);
if ( !v13 )
{
v7 = 160;
v8 = 694;
goto LABEL_11;
}
v11 = 1016;
v12 = 4101;
LABEL_33:
v14 = a1;
v10 = 0;
v15 = v13;
return sub_1005EC7FC(v14, 6, v11, v12, v10, v15);
}