{"type": "func", "start": 17398248, "end": 17398368, "name": "BN_nnmod", "pseudocode": "// \n// BN_nnmod from 0x10979e8 to 0x1097a60 (120 bytes)\n// \n// 29 xrefs:\n// > ossl_ecdsa_sign_setup @ 0x1012be4\n// > ossl_ecdsa_sign_sig @ 0x1013354\n// > ossl_ecdsa_verify_sig @ 0x1013c20\n// > sub_10150E8 @ 0x1015eb8\n// > sub_10150E8 @ 0x1015f14\n// > ec_GFp_simple_set_compressed_coordinates @ 0x1016990\n// > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x1017ad0\n// > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x1017b34\n// > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x1017b74\n// > ec_GFp_simple_group_set_curve @ 0x1018484\n// > ec_GFp_simple_group_set_curve @ 0x10184c0\n// > SRP_Verify_B_mod_N @ 0x105cf9c\n// > sub_10945E0 @ 0x10946cc\n// > BN_mod_exp_mont @ 0x1095478\n// > BN_mod_exp_simple @ 0x1095dc8\n// > int_bn_mod_inverse @ 0x1096b60\n// > int_bn_mod_inverse @ 0x1096c38\n// > int_bn_mod_inverse @ 0x1096e70\n// > int_bn_mod_inverse @ 0x10971ec\n// > BN_kronecker @ 0x1097968\n// > BN_mod_add @ 0x1097aac\n// > BN_mod_sub @ 0x1097b5c\n// > BN_mod_mul @ 0x1097c18\n// > BN_mod_lshift1 @ 0x1097d0c\n// > BN_mod_lshift @ 0x1097e90\n// > BN_mod_sqrt @ 0x10991d0\n// > BN_mod_sqrt @ 0x10993e0\n// > BN_mod_sqrt @ 0x109958c\n// > <???> @ 0xa4a10\n// \n// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 13:17:24 +0000\n// \n\n__int64 __fastcall BN_nnmod(__int64 a1, __int64 a2, __int64 a3, int32x2_t *a4)\n{\n  __int64 result; // x0\n\n  result = BN_div(0, a1, a2, a3, a4);\n  if ( (_DWORD)result )\n  {\n    result = 1;\n    if ( *(_DWORD *)(a1 + 16) )\n    {\n      if ( *(_DWORD *)(a3 + 16) )\n        return BN_sub(a1, a1, a3);\n      else\n        return (__int64)BN_add(a1, a1, a3);\n    }\n  }\n  return result;\n}", "assembly": "; \n; BN_nnmod from 0x10979e8 to 0x1097a60 (120 bytes)\n; \n; 29 xrefs:\n; > ossl_ecdsa_sign_setup @ 0x1012be4\n; > ossl_ecdsa_sign_sig @ 0x1013354\n; > ossl_ecdsa_verify_sig @ 0x1013c20\n; > sub_10150E8 @ 0x1015eb8\n; > sub_10150E8 @ 0x1015f14\n; > ec_GFp_simple_set_compressed_coordinates @ 0x1016990\n; > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x1017ad0\n; > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x1017b34\n; > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x1017b74\n; > ec_GFp_simple_group_set_curve @ 0x1018484\n; > ec_GFp_simple_group_set_curve @ 0x10184c0\n; > SRP_Verify_B_mod_N @ 0x105cf9c\n; > sub_10945E0 @ 0x10946cc\n; > BN_mod_exp_mont @ 0x1095478\n; > BN_mod_exp_simple @ 0x1095dc8\n; > int_bn_mod_inverse @ 0x1096b60\n; > int_bn_mod_inverse @ 0x1096c38\n; > int_bn_mod_inverse @ 0x1096e70\n; > int_bn_mod_inverse @ 0x10971ec\n; > BN_kronecker @ 0x1097968\n; > BN_mod_add @ 0x1097aac\n; > BN_mod_sub @ 0x1097b5c\n; > BN_mod_mul @ 0x1097c18\n; > BN_mod_lshift1 @ 0x1097d0c\n; > BN_mod_lshift @ 0x1097e90\n; > BN_mod_sqrt @ 0x10991d0\n; > BN_mod_sqrt @ 0x10993e0\n; > BN_mod_sqrt @ 0x109958c\n; > <???> @ 0xa4a10\n; \n; This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 13:17:24 +0000\n; \nSTP             X29, X30, [SP,#-0x20+var_s0]!                          ; +0x0, 0x10979e8\nMOV             X5, X1                                                 ; +0x4, 0x10979ec\nMOV             X4, X3                                                 ; +0x8, 0x10979f0\nMOV             X29, SP                                                ; +0xc, 0x10979f4\nSTP             X19, X20, [SP,#var_s10]                                ; +0x10, 0x10979f8\nMOV             X19, X0                                                ; +0x14, 0x10979fc\nMOV             X20, X2                                                ; +0x18, 0x1097a00\nMOV             X0, #0                                                 ; +0x1c, 0x1097a04\nMOV             X1, X19                                                ; +0x20, 0x1097a08\nMOV             X2, X5                                                 ; +0x24, 0x1097a0c\nMOV             X3, X20                                                ; +0x28, 0x1097a10\nBL              BN_div                                                 ; +0x2c, 0x1097a14\nCBZ             W0, loc_1097A48                                        ; +0x30, 0x1097a18\nLDR             W1, [X19,#0x10]                                        ; +0x34, 0x1097a1c\nMOV             W0, #1                                                 ; +0x38, 0x1097a20\nCBZ             W1, loc_1097A48                                        ; +0x3c, 0x1097a24\nLDR             W0, [X20,#0x10]                                        ; +0x40, 0x1097a28\nCBNZ            W0, loc_1097A54                                        ; +0x44, 0x1097a2c\nADRP            X3, #BN_add_ptr@PAGE                                   ; +0x48, 0x1097a30\nLDR             X3, [X3,#BN_add_ptr@PAGEOFF]; BN_add                   ; +0x4c, 0x1097a34\nMOV             X0, X19                                                ; +0x50, 0x1097a38\nMOV             X1, X19                                                ; +0x54, 0x1097a3c\nMOV             X2, X20                                                ; +0x58, 0x1097a40\nBLR             X3 ; BN_add BN_sub                                     ; +0x5c, 0x1097a44\nLDP             X19, X20, [SP,#var_s10]                                ; +0x60, 0x1097a48\nLDP             X29, X30, [SP+var_s0],#0x20                            ; +0x64, 0x1097a4c\nRET                                                                    ; +0x68, 0x1097a50\nADRP            X3, #BN_sub_ptr@PAGE                                   ; +0x6c, 0x1097a54\nLDR             X3, [X3,#BN_sub_ptr@PAGEOFF]; BN_sub                   ; +0x70, 0x1097a58\nB               loc_1097A38                                            ; +0x74, 0x1097a5c", "xrefs": ["ossl_ecdsa_sign_setup @ 0x1012be4", "ossl_ecdsa_sign_sig @ 0x1013354", "ossl_ecdsa_verify_sig @ 0x1013c20", "sub_10150E8 @ 0x1015eb8", "sub_10150E8 @ 0x1015f14", "ec_GFp_simple_set_compressed_coordinates @ 0x1016990", "ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x1017ad0", "ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x1017b34", "ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x1017b74", "ec_GFp_simple_group_set_curve @ 0x1018484", "ec_GFp_simple_group_set_curve @ 0x10184c0", "SRP_Verify_B_mod_N @ 0x105cf9c", "sub_10945E0 @ 0x10946cc", "BN_mod_exp_mont @ 0x1095478", "BN_mod_exp_simple @ 0x1095dc8", "int_bn_mod_inverse @ 0x1096b60", "int_bn_mod_inverse @ 0x1096c38", "int_bn_mod_inverse @ 0x1096e70", "int_bn_mod_inverse @ 0x10971ec", "BN_kronecker @ 0x1097968", "BN_mod_add @ 0x1097aac", "BN_mod_sub @ 0x1097b5c", "BN_mod_mul @ 0x1097c18", "BN_mod_lshift1 @ 0x1097d0c", "BN_mod_lshift @ 0x1097e90", "BN_mod_sqrt @ 0x10991d0", "BN_mod_sqrt @ 0x10993e0", "BN_mod_sqrt @ 0x109958c", "<???> @ 0xa4a10"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}