// // BN_GF2m_mod_arr from 0x8c9254 to 0x8c94cc (632 bytes) // // 12 xrefs: // > ec_GF2m_simple_set_compressed_coordinates @ 0x888ea0 // > ec_GF2m_simple_group_set_curve @ 0x889a6c // > ec_GF2m_simple_group_set_curve @ 0x889adc // > ec_GF2m_simple_group_check_discriminant @ 0x889b70 // > BN_GF2m_mod_sqr_arr @ 0x8c95dc // > BN_GF2m_mod_mul_arr @ 0x8c978c // > BN_GF2m_mod_exp_arr @ 0x8c9828 // > BN_GF2m_mod_solve_quad_arr @ 0x8c9a04 // > BN_GF2m_mod_solve_quad_arr @ 0x8c9abc // > BN_GF2m_mod @ 0x8c9e2c // > sub_8D1010 @ 0x8d1128 // > @ 0x6a82c // // 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 // int __fastcall BN_GF2m_mod_arr(int **a1, int **a2, int *a3) { int result; // r0 int v7; // lr int *v8; // r12 int *v9; // r0 int v10; // r2 int i; // r3 int v12; // t1 int v13; // r6 int v14; // lr int v15; // r6 unsigned int v16; // r0 int v17; // r2 _DWORD *v18; // r1 int v19; // r3 int v20; // r2 int v21; // r3 int v22; // r2 int v23; // t1 int v24; // r3 unsigned int v25; // r1 int v26; // r3 unsigned int v27; // r2 int *j; // lr int v29; // r3 _DWORD *v30; // r0 int v31; // r1 int v32; // r3 int v33; // r1 unsigned int v34; // r8 int v35; // r1 int v36; // t1 if ( *a3 ) { if ( a2 == a1 ) { v13 = *a3; v8 = *a1; v7 = (int)a1[1]; } else { result = bn_wexpand((int)a1, (int)a2[1]); if ( !result ) return result; v7 = (int)a2[1]; v8 = *a1; if ( v7 > 0 ) { v9 = v8 - 1; v10 = (int)(*a2 - 1); for ( i = 0; i < v7; ++i ) { v12 = *(_DWORD *)(v10 + 4); v10 += 4; v9[1] = v12; ++v9; v7 = (int)a2[1]; } } a1[1] = (int *)v7; v13 = *a3; } v14 = v7 - 1; v15 = v13 / 32; while ( v15 < v14 ) { v16 = v8[v14]; if ( v16 ) { v8[v14] = 0; v17 = a3[1]; if ( v17 ) { v18 = a3 + 1; do { v19 = *a3 - v17; v20 = v14 - v19 / 32; v21 = v19 % 32; v8[v20] ^= v16 >> v21; v22 = 4 * v20 - 4; if ( v21 ) *(int *)((char *)v8 + v22) ^= v16 << (32 - v21); v23 = v18[1]; ++v18; v17 = v23; } while ( v23 ); } v24 = *a3 % 32; v8[v14 - v15] ^= v16 >> v24; if ( v24 ) v8[v14 - v15 - 1] ^= v16 << (32 - v24); } else { --v14; } } if ( v14 == v15 ) { v25 = v8[v14]; v26 = *a3 % 32; v27 = v25 >> v26; for ( j = &v8[v14]; v27; v27 = (unsigned int)*j >> v26 ) { if ( v26 ) v26 = v25 << (32 - v26) >> (32 - v26); *j = v26; *v8 ^= v27; v29 = a3[1]; if ( v29 ) { v30 = a3 + 1; do { v31 = v29 / 32; v32 = v29 % 32; v8[v31] ^= v27 << v32; v33 = 4 * v31; if ( v32 ) { v34 = v27 >> (32 - v32); v35 = v33 + 4; if ( v34 ) *(int *)((char *)v8 + v35) ^= v34; } v36 = v30[1]; ++v30; v29 = v36; } while ( v36 ); } v25 = *j; v26 = *a3 % 32; } } bn_correct_top(a1); return 1; } else { BN_set_word(a1, 0); return 1; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source