; modexp.asm - Modular exponentiation test suite ; ; Copyright (C) 2015-2016 Jeffrey Amelynck ; ; This program is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program. If not, see . format binary as "" __DEBUG__ = 1 __DEBUG_LEVEL__ = 1 MAX_BITS = 256 use32 db 'MENUET01' ; signature dd 1 ; header version dd start ; entry point dd i_end ; initialized size dd mem+4096 ; required memory dd mem+4096 ; stack pointer dd 0 ; parameters dd 0 ; path include '../../../macros.inc' purge mov,add,sub include '../../../proc32.inc' include '../../../debug-fdo.inc' include '../mpint.inc' start: mov dword[mpint_A+00], 32 mov dword[mpint_A+04], 0xCAFEBABE mov dword[mpint_A+08], 0xDEADBEEF mov dword[mpint_A+12], 0xCAFEBABE mov dword[mpint_A+16], 0xDEADBEEF mov dword[mpint_A+20], 0xCAFEBABE mov dword[mpint_A+24], 0xDEADBEEF mov dword[mpint_A+28], 0xCAFEBABE mov dword[mpint_A+32], 0xDEADBEEF mov dword[mpint_B+00], 16 mov dword[mpint_B+04], 0xDEADBEEF mov dword[mpint_B+08], 0xCAFEBABE mov dword[mpint_B+12], 0xDEADBEEF mov dword[mpint_B+16], 0xCAFEBABE mov dword[mpint_B+20], 0 mov dword[mpint_B+24], 0 mov dword[mpint_B+28], 0 mov dword[mpint_B+32], 0 stdcall mpint_print, mpint_A stdcall mpint_print, mpint_B DEBUGF 1, "mpint_mod\n" rdtsc push eax stdcall mpint_mod, mpint_A, mpint_B rdtsc pop edx sub eax, edx call fdo_debug_outdec DEBUGF 1, "\n" stdcall mpint_length, mpint_A stdcall mpint_print, mpint_A stdcall mpint_print, mpint_B DEBUGF 1, "mpint_mul\n" rdtsc push eax stdcall mpint_mul, mpint_C, mpint_A, mpint_B rdtsc pop edx sub eax, edx call fdo_debug_outdec DEBUGF 1, "\n" stdcall mpint_length, mpint_C stdcall mpint_print, mpint_C mov dword[mpint_C], 16 mov dword[mpint_C+20], 0 mov dword[mpint_C+24], 0 mov dword[mpint_C+28], 0 mov dword[mpint_C+32], 0 DEBUGF 1, "mpint_modexp\n" rdtsc push eax stdcall mpint_modexp, mpint_D, mpint_A, mpint_B, mpint_C rdtsc pop edx sub eax, edx call fdo_debug_outdec DEBUGF 1, "\n" stdcall mpint_length, mpint_D stdcall mpint_print, mpint_D mcall -1 i_end: mpint_A rb MPINT_MAX_LEN+4 mpint_B rb MPINT_MAX_LEN+4 mpint_C rb MPINT_MAX_LEN+4 mpint_D rb MPINT_MAX_LEN+4 mpint_tmp rb MPINT_MAX_LEN+4 include_debug_strings mem: