{"type": "func", "start": 15165988, "end": 15166204, "name": "BN_GF2m_mod_sqrt", "pseudocode": "// \n// BN_GF2m_mod_sqrt from 0xe76a24 to 0xe76afc (216 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x670c8\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n__int64 __fastcall BN_GF2m_mod_sqrt(unsigned __int64 *a1, __int64 *a2, __int64 a3, int32x2_t *a4)\n{\n  int v8; // w21\n  int *v9; // x19\n  int v10; // w0\n  unsigned int v11; // w20\n\n  v8 = BN_num_bits(a3) + 1;\n  v9 = (int *)CRYPTO_malloc((void *)(4LL * v8), (__int64)\"crypto/bn/bn_gf2m.c\", 1023);\n  if ( v9 )\n  {\n    v10 = BN_GF2m_poly2arr(a3, (__int64)v9, v8);\n    v11 = v10;\n    if ( v10 <= v8 && v10 )\n      v11 = BN_GF2m_mod_sqrt_arr(a1, a2, v9, a4);\n    else\n      ERR_put_error(3, 137, 106, (__int64)\"crypto/bn/bn_gf2m.c\", 1027);\n  }\n  else\n  {\n    v11 = 0;\n  }\n  CRYPTO_free(v9, (__int64)\"crypto/bn/bn_gf2m.c\", 1033);\n  return v11;\n}", "assembly": "; \n; BN_GF2m_mod_sqrt from 0xe76a24 to 0xe76afc (216 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x670c8\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X29, X30, [SP,#var_50]!                                ; +0x0, 0xe76a24\nMOV             X29, SP                                                ; +0x4, 0xe76a28\nSTR             X25, [SP,#0x50+var_10]                                 ; +0x8, 0xe76a2c\nMOV             X25, X0                                                ; +0xc, 0xe76a30\nMOV             X0, X2                                                 ; +0x10, 0xe76a34\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x14, 0xe76a38\nSTP             X21, X22, [SP,#0x50+var_30]                            ; +0x18, 0xe76a3c\nSTP             X23, X24, [SP,#0x50+var_20]                            ; +0x1c, 0xe76a40\nMOV             X20, X2                                                ; +0x20, 0xe76a44\nMOV             X24, X1                                                ; +0x24, 0xe76a48\nMOV             X23, X3                                                ; +0x28, 0xe76a4c\nADRP            X22, #aCryptoBnBnGf2m@PAGE; \"crypto/bn/bn_gf2m.c\"      ; +0x2c, 0xe76a50\nBL              BN_num_bits                                            ; +0x30, 0xe76a54\nADD             W21, W0, #1                                            ; +0x34, 0xe76a58\nSBFIZ           X0, X21, #2, #0x20 ; ' '                               ; +0x38, 0xe76a5c\nADD             X1, X22, #aCryptoBnBnGf2m@PAGEOFF; \"crypto/bn/bn_gf2m.c\" ; +0x3c, 0xe76a60\nMOV             W2, #0x3FF                                             ; +0x40, 0xe76a64\nBL              CRYPTO_malloc                                          ; +0x44, 0xe76a68\nMOV             X19, X0                                                ; +0x48, 0xe76a6c\nCBZ             X0, loc_E76AF4                                         ; +0x4c, 0xe76a70\nMOV             X0, X20                                                ; +0x50, 0xe76a74\nMOV             X1, X19                                                ; +0x54, 0xe76a78\nMOV             W2, W21                                                ; +0x58, 0xe76a7c\nBL              BN_GF2m_poly2arr                                       ; +0x5c, 0xe76a80\nCMP             W0, W21                                                ; +0x60, 0xe76a84\nMOV             W20, W0                                                ; +0x64, 0xe76a88\nB.GT            loc_E76AD8                                             ; +0x68, 0xe76a8c\nCBZ             W0, loc_E76AD8                                         ; +0x6c, 0xe76a90\nMOV             X0, X25                                                ; +0x70, 0xe76a94\nMOV             X1, X24                                                ; +0x74, 0xe76a98\nMOV             X2, X19                                                ; +0x78, 0xe76a9c\nMOV             X3, X23                                                ; +0x7c, 0xe76aa0\nBL              BN_GF2m_mod_sqrt_arr                                   ; +0x80, 0xe76aa4\nMOV             W20, W0                                                ; +0x84, 0xe76aa8\nMOV             X0, X19                                                ; +0x88, 0xe76aac\nADD             X1, X22, #aCryptoBnBnGf2m@PAGEOFF; \"crypto/bn/bn_gf2m.c\" ; +0x8c, 0xe76ab0\nMOV             W2, #0x409                                             ; +0x90, 0xe76ab4\nBL              CRYPTO_free                                            ; +0x94, 0xe76ab8\nLDR             X25, [SP,#0x50+var_10]                                 ; +0x98, 0xe76abc\nMOV             W0, W20                                                ; +0x9c, 0xe76ac0\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0xa0, 0xe76ac4\nLDP             X21, X22, [SP,#0x50+var_30]                            ; +0xa4, 0xe76ac8\nLDP             X23, X24, [SP,#0x50+var_20]                            ; +0xa8, 0xe76acc\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0xac, 0xe76ad0\nRET                                                                    ; +0xb0, 0xe76ad4\nMOV             W0, #3                                                 ; +0xb4, 0xe76ad8\nMOV             W1, #0x89                                              ; +0xb8, 0xe76adc\nMOV             W2, #0x6A ; 'j'                                        ; +0xbc, 0xe76ae0\nADD             X3, X22, #aCryptoBnBnGf2m@PAGEOFF; \"crypto/bn/bn_gf2m.c\" ; +0xc0, 0xe76ae4\nMOV             W4, #0x403                                             ; +0xc4, 0xe76ae8\nBL              ERR_put_error                                          ; +0xc8, 0xe76aec\nB               loc_E76AAC                                             ; +0xcc, 0xe76af0\nMOV             W20, W0                                                ; +0xd0, 0xe76af4\nB               loc_E76AAC                                             ; +0xd4, 0xe76af8", "xrefs": ["<???> @ 0x670c8"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}