{"type": "func", "start": 11400584, "end": 11400788, "name": "BN_GF2m_mod_sqrt", "pseudocode": "// \n// BN_GF2m_mod_sqrt from 0xadf588 to 0xadf654 (204 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x854cc\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 12:09:33 +0000\n// \n\nint __fastcall BN_GF2m_mod_sqrt(int **a1, int **a2, int **a3, int ***a4)\n{\n  int v8; // r5\n  int *v9; // r10\n  int v10; // r4\n  int v11; // r0\n  _BOOL4 v12; // r12\n\n  v8 = BN_num_bits(a3) + 1;\n  v9 = (int *)CRYPTO_malloc((void *)(4 * v8), (int)\"crypto/bn/bn_gf2m.c\", 1023);\n  if ( v9 )\n  {\n    v11 = BN_GF2m_poly2arr(a3, (int)v9, v8);\n    v12 = v11 == 0;\n    if ( v11 > v8 )\n      v12 = 1;\n    v10 = v11;\n    if ( v12 )\n      ERR_put_error(3, 137, 106, (int)\"crypto/bn/bn_gf2m.c\", 1027);\n    else\n      v10 = BN_GF2m_mod_sqrt_arr(a1, a2, v9, a4);\n  }\n  else\n  {\n    v10 = 0;\n  }\n  CRYPTO_free(v9, (int)\"crypto/bn/bn_gf2m.c\", 1033);\n  return v10;\n}", "assembly": "; \n; BN_GF2m_mod_sqrt from 0xadf588 to 0xadf654 (204 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x854cc\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 12:09:33 +0000\n; \nPUSH            {R4-R10,LR}                                            ; +0x0, 0xadf588\nMOV             R9, R0                                                 ; +0x4, 0xadf58c\nSUB             SP, SP, #8                                             ; +0x8, 0xadf590\nMOV             R0, R2                                                 ; +0xc, 0xadf594\nMOV             R4, R2                                                 ; +0x10, 0xadf598\nMOV             R8, R1                                                 ; +0x14, 0xadf59c\nMOV             R7, R3                                                 ; +0x18, 0xadf5a0\nBL              BN_num_bits                                            ; +0x1c, 0xadf5a4\nLDR             R6, =(aCryptoBnBnGf2m - 0xADF5B8); \"crypto/bn/bn_gf2m.c\" ; +0x20, 0xadf5a8\nLDR             R2, =0x3FF                                             ; +0x24, 0xadf5ac\nADD             R6, PC, R6; \"crypto/bn/bn_gf2m.c\"                      ; +0x28, 0xadf5b0\nMOV             R1, R6                                                 ; +0x2c, 0xadf5b4\nADD             R5, R0, #1                                             ; +0x30, 0xadf5b8\nMOV             R0, R5,LSL#2                                           ; +0x34, 0xadf5bc\nBL              CRYPTO_malloc                                          ; +0x38, 0xadf5c0\nSUBS            R10, R0, #0                                            ; +0x3c, 0xadf5c4\nMOVEQ           R4, R10                                                ; +0x40, 0xadf5c8\nBEQ             loc_ADF614                                             ; +0x44, 0xadf5cc\nMOV             R0, R4                                                 ; +0x48, 0xadf5d0\nMOV             R1, R10                                                ; +0x4c, 0xadf5d4\nMOV             R2, R5                                                 ; +0x50, 0xadf5d8\nBL              BN_GF2m_poly2arr                                       ; +0x54, 0xadf5dc\nCLZ             R12, R0                                                ; +0x58, 0xadf5e0\nMOV             R12, R12,LSR#5                                         ; +0x5c, 0xadf5e4\nCMP             R0, R5                                                 ; +0x60, 0xadf5e8\nORRGT           R12, R12, #1                                           ; +0x64, 0xadf5ec\nCMP             R12, #0                                                ; +0x68, 0xadf5f0\nMOV             R4, R0                                                 ; +0x6c, 0xadf5f4\nBNE             loc_ADF634                                             ; +0x70, 0xadf5f8\nMOV             R0, R9                                                 ; +0x74, 0xadf5fc\nMOV             R1, R8                                                 ; +0x78, 0xadf600\nMOV             R3, R7                                                 ; +0x7c, 0xadf604\nMOV             R2, R10                                                ; +0x80, 0xadf608\nBL              BN_GF2m_mod_sqrt_arr                                   ; +0x84, 0xadf60c\nMOV             R4, R0                                                 ; +0x88, 0xadf610\nLDR             R1, =(aCryptoBnBnGf2m - 0xADF624); \"crypto/bn/bn_gf2m.c\" ; +0x8c, 0xadf614\nMOV             R0, R10                                                ; +0x90, 0xadf618\nADD             R1, PC, R1; \"crypto/bn/bn_gf2m.c\"                      ; +0x94, 0xadf61c\nLDR             R2, =0x409                                             ; +0x98, 0xadf620\nBL              CRYPTO_free                                            ; +0x9c, 0xadf624\nMOV             R0, R4                                                 ; +0xa0, 0xadf628\nADD             SP, SP, #8                                             ; +0xa4, 0xadf62c\nPOP             {R4-R10,PC}                                            ; +0xa8, 0xadf630\nLDR             R2, =0x403                                             ; +0xac, 0xadf634\nSTR             R2, [SP,#8+var_8]                                      ; +0xb0, 0xadf638\nMOV             R3, R6                                                 ; +0xb4, 0xadf63c\nMOV             R0, #3                                                 ; +0xb8, 0xadf640\nMOV             R1, #0x89                                              ; +0xbc, 0xadf644\nMOV             R2, #0x6A ; 'j'                                        ; +0xc0, 0xadf648\nBL              ERR_put_error                                          ; +0xc4, 0xadf64c\nB               loc_ADF614                                             ; +0xc8, 0xadf650", "xrefs": ["<???> @ 0x854cc"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "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"}