// // ec_GFp_simple_group_check_discriminant from 0xd994f8 to 0xd99704 (524 bytes) // // 4 xrefs: // > @ 0x4aa60 // > @ 0x1222140 // > @ 0x12222c0 // > @ 0x1222440 // // 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 // bool __fastcall ec_GFp_simple_group_check_discriminant(_QWORD *a1, __int64 a2, __int64 a3) { __int64 v4; // x19 __int64 v5; // x21 __int64 v6; // x24 unsigned __int64 *v7; // x22 unsigned __int64 *v8; // x23 __int64 v9; // x25 __int64 *v10; // x26 unsigned int (__fastcall *v11)(_QWORD *, unsigned __int64 *, _QWORD, __int64); // x4 _BOOL4 v12; // w20 v4 = a2; v5 = 0; v6 = a1[8]; if ( !a2 ) { v5 = BN_CTX_new(a1, 0, a3); v4 = v5; if ( !v5 ) { v12 = 0; ERR_put_error(16, 165, 65, "crypto/ec/ecp_smpl.c", 253); goto LABEL_7; } } BN_CTX_start(v4); v7 = (unsigned __int64 *)BN_CTX_get(v4); v8 = (unsigned __int64 *)BN_CTX_get(v4); v9 = BN_CTX_get(v4); v10 = (__int64 *)BN_CTX_get(v4); if ( !BN_CTX_get(v4) ) goto LABEL_5; v11 = *(unsigned int (__fastcall **)(_QWORD *, unsigned __int64 *, _QWORD, __int64))(*a1 + 296LL); if ( v11 ) { if ( !v11(a1, v7, a1[12], v4) || !(*(unsigned int (__fastcall **)(_QWORD *, unsigned __int64 *, _QWORD, __int64))(*a1 + 296LL))( a1, v8, a1[13], v4) ) { goto LABEL_5; } } else if ( !BN_copy(v7, a1[12]) || !BN_copy(v8, a1[13]) ) { goto LABEL_5; } if ( BN_is_zero((__int64)v7) ) { v12 = !BN_is_zero((__int64)v8); goto LABEL_6; } v12 = 1; if ( BN_is_zero((__int64)v8) ) goto LABEL_6; if ( (unsigned int)BN_mod_sqr(v9, v7, v6, v4) && (unsigned int)BN_mod_mul(v10, v9, v7, v6, v4) && (unsigned int)BN_lshift(v9, v10, 2) && (unsigned int)BN_mod_sqr(v10, v8, v6, v4) && (unsigned int)BN_mul_word((unsigned __int64 *)v10, 27) && (unsigned int)BN_mod_add(v7, v9, v10, v6, v4) ) { v12 = !BN_is_zero((__int64)v7); goto LABEL_6; } LABEL_5: v12 = 0; LABEL_6: BN_CTX_end(v4); LABEL_7: BN_CTX_free(v5); return v12; }
GD Web Decomp Icon

GD Web Decomp

Raw Source