亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aescrypt.asm

?? 算法從speakfs提取
?? ASM
字號:

; -------------------------------------------------------------------------
; Copyright (c) 2001, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
; All rights reserved.
;
; LICENSE TERMS
;
; The free distribution and use of this software in both source and binary 
; form is allowed (with or without changes) provided that:
;
;   1. distributions of this source code include the above copyright 
;      notice, this list of conditions and the following disclaimer;
;
;   2. distributions in binary form include the above copyright
;      notice, this list of conditions and the following disclaimer
;      in the documentation and/or other associated materials;
;
;   3. the copyright holder's name is not used to endorse products 
;      built using this software without specific written permission.
;
; DISCLAIMER
;
; This software is provided 'as is' with no explicit or implied warranties
; in respect of its properties including, but not limited to, correctness 
; and fitness for purpose.
; -------------------------------------------------------------------------
; Issue Date: 29/07/2002

; An AES (Rijndael) implementation for the Pentium MMX family using the NASM
; assembler <http://www.web-sites.co.uk/nasm/>. This version only implements
; the standard AES block length (128 bits, 16 bytes) with the same interface
; as that used in my C/C++ implementation.   This code does not preserve the
; eax, ecx or edx registers or the artihmetic status flags. However, the ebx, 
; esi, edi, and ebp registers are preserved across calls.    Only encryption
; and decryption are implemented here, the key schedule code being that from
; compiling aes.c with USE_ASM defined.  This code uses VC++ register saving
; conentions; if it is used with another compiler, its conventions for using
; and saving registers will need to be checked.

    section .text use32

; aes_rval aes_enc_blk(const unsigned char in_blk[], unsigned char out_blk[], const aes_ctx cx[1]);
; aes_rval aes_dec_blk(const unsigned char in_blk[], unsigned char out_blk[], const aes_ctx cx[1]);
    
%define ENCRYPTION  ; define if encryption is needed 
%define DECRYPTION  ; define if decryption is needed
;%define USE_MMX    ; include this to use MMX registers for temporary storage
;%define USE_EMMS   ; include this if you make use of floating point operations

%ifdef  USE_MMX
%ifdef  USE_EMMS
%define EMMS_ON
%endif
%endif

tlen:   equ  1024   ; length of each of 4 'xor' arrays (256 32-bit words)

; offsets to parameters with one register pushed onto stack

in_blk: equ     8   ; input byte array address parameter
out_blk:equ    12   ; output byte array address parameter
ctx:    equ    16   ; AES context structure

; offsets in context structure

ksch:   equ     0   ; encryption key schedule base address
nrnd:   equ   256   ; number of rounds
nblk:   equ   260   ; number of rounds

; register mapping for encrypt and decrypt subroutines

%define r0  eax
%define r1  ebx
%define r2  ecx
%define r3  edx
%define r4  esi
%define r5  edi
%define r6  ebp

%define eaxl  al
%define eaxh  ah
%define ebxl  bl
%define ebxh  bh
%define ecxl  cl
%define ecxh  ch
%define edxl  dl
%define edxh  dh

; This macro takes a 32-bit word representing a column and uses
; each of its four bytes to index into four tables of 256 32-bit
; words to obtain values that are then xored into the appropriate
; output registers r0, r1, r4 or r5.  

; Parameters:
;   %1  out_state[0]
;   %2  out_state[1]
;   %3  out_state[2]
;   %4  out_state[3]
;   %5  table base address
;   %6  input register for the round (destroyed)
;   %7  scratch register for the round

%macro do_col 7

    movzx   %7,%6l
    xor     %1,[4*%7+%5]
    movzx   %7,%6h
    shr     %6,16
    xor     %2,[4*%7+%5+tlen]
    movzx   %7,%6l
    movzx   %6,%6h
    xor     %3,[4*%7+%5+2*tlen] 
    xor     %4,[4*%6+%5+3*tlen]

%endmacro

; initialise output registers from the key schedule

%macro do_fcol 8

    mov     %1,[%8]
    movzx   %7,%6l
    mov     %2,[%8+12]
    xor     %1,[4*%7+%5]
    mov     %4,[%8+ 4]
    movzx   %7,%6h
    shr     %6,16
    xor     %2,[4*%7+%5+tlen]
    movzx   %7,%6l
    movzx   %6,%6h
    xor     %4,[4*%6+%5+3*tlen]
    mov     %6,%3
    mov     %3,[%8+ 8]
    xor     %3,[4*%7+%5+2*tlen] 

%endmacro

; initialise output registers from the key schedule

%macro do_icol 8

    mov     %1,[%8]
    movzx   %7,%6l
    mov     %2,[%8+ 4]
    xor     %1,[4*%7+%5]
    mov     %4,[%8+12]
    movzx   %7,%6h
    shr     %6,16
    xor     %2,[4*%7+%5+tlen]
    movzx   %7,%6l
    movzx   %6,%6h
    xor     %4,[4*%6+%5+3*tlen]
    mov     %6,%3
    mov     %3,[%8+ 8]
    xor     %3,[4*%7+%5+2*tlen] 

%endmacro

; These macros implement either MMX or stack based local variables

%ifdef  USE_MMX

%macro  save 2
    movd    mm%1,%2
%endmacro

%macro  restore 2
    movd    %1,mm%2
%endmacro

%else

%macro  save 2
    mov     [esp+4*%1],%2
%endmacro

%macro  restore 2
    mov     %1,[esp+4*%2]
%endmacro

%endif

; This macro performs a forward encryption cycle. It is entered with
; the first previous round column values in r0, r1, r4 and r5 and
; exits with the final values in the same registers, using the MMX
; registers mm0-mm1 or the stack for temporary storage

%macro fwd_rnd 1-2 _ft_tab

; mov current column values into the MMX registers

    mov     r2,r0
    save    0,r1
    save    1,r5

; compute new column values

    do_fcol r0,r5,r4,r1, %2, r2,r3, %1
    do_col  r4,r1,r0,r5, %2, r2,r3
    restore r2,0
    do_col  r1,r0,r5,r4, %2, r2,r3
    restore r2,1
    do_col  r5,r4,r1,r0, %2, r2,r3

%endmacro

; This macro performs an inverse encryption cycle. It is entered with
; the first previous round column values in r0, r1, r4 and r5 and
; exits with the final values in the same registers, using the MMX
; registers mm0-mm1 or the stack for temporary storage

%macro inv_rnd 1-2 _it_tab

; mov current column values into the MMX registers

    mov     r2,r0
    save    0,r1
    save    1,r5

; compute new column values

    do_icol r0,r1,r4,r5, %2, r2,r3, %1
    do_col  r4,r5,r0,r1, %2, r2,r3
    restore r2,0
    do_col  r1,r4,r5,r0, %2, r2,r3
    restore r2,1
    do_col  r5,r0,r1,r4, %2, r2,r3

%endmacro

; AES (Rijndael) Encryption Subroutine

%ifdef  ENCRYPTION

    global  _aes_enc_blk

    extern  _ft_tab
    extern  _fl_tab

_aes_enc_blk:
    push    ebp
    mov     ebp,[esp+ctx]       ; pointer to context
    xor     eax,eax
    test    [ebp+nblk],byte 1
    je      .0
    cmp     eax,[ebp+nrnd]      ; encryption/decryption flags
    jne     short .1
.0: pop     ebp
    ret            

; CAUTION: the order and the values used in these assigns 
; rely on the register mappings

.1: push    ebx
    mov     r2,[esp+in_blk+4]
    push    esi
    mov     r3,[ebp+nrnd]   ; number of rounds
    push    edi
    lea     r6,[ebp+ksch]   ; key pointer

; input four columns and xor in first round key

    mov     r0,[r2]
    mov     r1,[r2+4]
    mov     r4,[r2+8]
    mov     r5,[r2+12]
    xor     r0,[r6]
    xor     r1,[r6+4]
    xor     r4,[r6+8]
    xor     r5,[r6+12]

%ifndef USE_MMX
    sub     esp,8           ; space for register saves on stack
%endif
    add     r6,16           ; increment to next round key   
    sub     r3,10          
    je      .4              ; 10 rounds for 128-bit key
    add     r6,32  
    sub     r3,2
    je      .3              ; 12 rounds for 128-bit key
    add     r6,32  

.2: fwd_rnd r6-64           ; 14 rounds for 128-bit key
    fwd_rnd r6-48  
.3: fwd_rnd r6-32           ; 12 rounds for 128-bit key
    fwd_rnd r6-16  
.4: fwd_rnd r6              ; 10 rounds for 128-bit key
    fwd_rnd r6+ 16 
    fwd_rnd r6+ 32
    fwd_rnd r6+ 48
    fwd_rnd r6+ 64
    fwd_rnd r6+ 80
    fwd_rnd r6+ 96
    fwd_rnd r6+112
    fwd_rnd r6+128
    fwd_rnd r6+144,_fl_tab  ; last round uses a different table

; move final values to the output array.  CAUTION: the 
; order of these assigns rely on the register mappings

%ifndef USE_MMX
    add     esp,8
%endif
    mov     r6,[esp+out_blk+12]
    mov     [r6+12],r5
    pop     edi
    mov     [r6+8],r4
    pop     esi
    mov     [r6+4],r1
    pop     ebx
    mov     [r6],r0
    pop     ebp
    mov     eax,1
%ifdef  EMMS_ON
    emms
%endif
    ret

%endif

; AES (Rijndael) Decryption Subroutine

%ifdef  DECRYPTION

    global  _aes_dec_blk

    extern  _it_tab
    extern  _il_tab

_aes_dec_blk:
    push    ebp
    mov     ebp,[esp+ctx]       ; pointer to context
    xor     eax,eax
    test    [ebp+nblk],byte 2
    je      .0
    cmp     eax,[ebp+nrnd]      ; encryption/decryption flags
    jne     short .1
.0: pop     ebp
    ret            

; CAUTION: the order and the values used in these assigns 
; rely on the register mappings

.1: push    ebx
    mov     r2,[esp+in_blk+4]
    push    esi
    mov     r3,[ebp+nrnd]   ; number of rounds
    push    edi
    lea     r6,[ebp+ksch]   ; key pointer
    mov     r0,r3
    shl     r0,4
    add     r6,r0
    
; input four columns and xor in first round key

    mov     r0,[r2]
    mov     r1,[r2+4]
    mov     r4,[r2+8]
    mov     r5,[r2+12]
    xor     r0,[r6]
    xor     r1,[r6+4]
    xor     r4,[r6+8]
    xor     r5,[r6+12]

%ifndef USE_MMX
    sub     esp,8           ; space for register saves on stack
%endif
    sub     r6,16           ; increment to next round key   
    sub     r3,10          
    je      .4              ; 10 rounds for 128-bit key
    sub     r6,32  
    sub     r3,2
    je      .3              ; 12 rounds for 128-bit key
    sub     r6,32  

.2: inv_rnd r6+64           ; 14 rounds for 128-bit key 
    inv_rnd r6+48  
.3: inv_rnd r6+32           ; 12 rounds for 128-bit key
    inv_rnd r6+16  
.4: inv_rnd r6              ; 10 rounds for 128-bit key
    inv_rnd r6- 16 
    inv_rnd r6- 32
    inv_rnd r6- 48
    inv_rnd r6- 64
    inv_rnd r6- 80
    inv_rnd r6- 96
    inv_rnd r6-112
    inv_rnd r6-128
    inv_rnd r6-144,_il_tab  ; last round uses a different table

; move final values to the output array.  CAUTION: the 
; order of these assigns rely on the register mappings

%ifndef USE_MMX
    add     esp,8
%endif
    mov     r6,[esp+out_blk+12]
    mov     [r6+12],r5
    pop     edi
    mov     [r6+8],r4
    pop     esi
    mov     [r6+4],r1
    pop     ebx
    mov     [r6],r0
    pop     ebp
    mov     eax,1
%ifdef  EMMS_ON
    emms
%endif
    ret
    
%endif

    end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲日韩一区二区三区| 欧美精品在线观看一区二区| 亚洲欧美一区二区在线观看| 亚洲18色成人| 国产精品久久网站| 日本一区二区三区在线不卡| 欧美不卡一区二区三区| 欧美日韩中文另类| 91视频91自| 成人av在线观| 波多野结衣视频一区| 成人sese在线| 日韩欧美在线一区二区三区| 欧美高清精品3d| 亚洲免费伊人电影| 亚洲资源中文字幕| 亚洲一级二级三级| 91蜜桃婷婷狠狠久久综合9色| 久久久精品综合| 久久久国产精华| 麻豆精品一区二区综合av| 日本在线不卡一区| 国产在线一区二区| 国产在线播放一区三区四| 国产福利精品一区二区| 成人午夜激情在线| 91福利在线观看| 日韩一区二区电影网| 午夜精品在线看| 国产黄色91视频| 国产丝袜美腿一区二区三区| 一区二区三区四区国产精品| 午夜精品久久久久| 欧美性大战久久久久久久蜜臀 | 亚洲欧美一区二区三区极速播放 | 日韩欧美一级精品久久| 26uuu亚洲| 亚洲视频1区2区| 亚洲成人午夜电影| 欧美视频在线观看一区二区| 亚洲综合色在线| 欧美少妇性性性| 日本免费新一区视频| 88在线观看91蜜桃国自产| 国产精品免费丝袜| 蜜臀a∨国产成人精品| 日韩精品一区二区在线观看| 国模冰冰炮一区二区| 久久精品网站免费观看| 成人av集中营| 亚洲高清免费观看高清完整版在线观看| 久久国产精品无码网站| 91久久精品一区二区三区| 亚洲国产一区二区视频| 日韩午夜在线播放| 国产999精品久久久久久绿帽| 日韩免费成人网| 国产伦精品一区二区三区免费迷 | 国产一区二区三区在线看麻豆| 久久久不卡网国产精品一区| 成人av在线观| 亚洲高清免费一级二级三级| 精品国产免费人成电影在线观看四季| 中文字幕一区二区三区四区不卡| 色综合咪咪久久| 欧美激情一区三区| 捆绑变态av一区二区三区| 国产欧美精品一区二区色综合| 色哟哟欧美精品| 国产原创一区二区三区| 亚洲一区中文在线| 久久久99精品免费观看| 欧美在线观看视频一区二区| 日韩一区在线看| 欧美一区二区国产| 免费在线看成人av| 91精品国产综合久久精品麻豆| 韩国欧美一区二区| 亚洲国产精品自拍| 国产精品午夜在线观看| 欧美一级精品大片| 99久久婷婷国产综合精品电影| 国产精品久久久久久久浪潮网站| 欧美日韩成人激情| 舔着乳尖日韩一区| 国产精品国产三级国产普通话蜜臀 | 欧美激情资源网| 欧美一区二区成人| 91女神在线视频| 国产精品一二三区| 国产精品日韩精品欧美在线| 欧美一区二区三区性视频| 色久优优欧美色久优优| 国产成人免费视| 男女激情视频一区| 午夜精品一区二区三区免费视频| 国产精品久久久久久久久免费丝袜 | 国产.欧美.日韩| 全国精品久久少妇| 亚洲一区二区欧美日韩| 1区2区3区欧美| 欧美国产成人在线| 国产亚洲欧美中文| 精品成人私密视频| 精品电影一区二区三区| 91精品国产乱码久久蜜臀| 欧美日韩一区视频| 欧美特级限制片免费在线观看| 色噜噜狠狠成人网p站| 成人理论电影网| 成人黄色网址在线观看| 国产乱码精品一品二品| 激情综合五月婷婷| 亚洲天堂精品视频| 中文字幕中文字幕一区| 中文字幕精品一区二区精品绿巨人| 欧美大白屁股肥臀xxxxxx| 91精品久久久久久久久99蜜臂| 欧美日韩一区国产| 7777精品伊人久久久大香线蕉超级流畅 | 中文字幕制服丝袜成人av| 国产女人18毛片水真多成人如厕| 久久精品视频免费观看| 久久伊99综合婷婷久久伊| 亚洲精品一区二区三区99| 日韩欧美一区二区不卡| 精品裸体舞一区二区三区| 精品成人一区二区三区| 国产亚洲短视频| 国产精品毛片a∨一区二区三区| 亚洲欧美中日韩| 亚洲大片免费看| 日本中文在线一区| 国产精品99久久不卡二区| 成人黄色在线视频| 欧美日韩不卡在线| 精品国产一区a| 国产精品伦一区| 亚洲制服丝袜av| 免费成人av在线播放| 国产乱对白刺激视频不卡| 东方欧美亚洲色图在线| 99国产精品久| 91精品国产高清一区二区三区| 欧美一二区视频| 日本一区二区三区四区在线视频| 亚洲欧美色综合| 爽好久久久欧美精品| 亚洲桃色在线一区| 亚洲综合在线五月| 激情亚洲综合在线| 欧美亚洲综合在线| 久久久精品中文字幕麻豆发布| 亚洲男人的天堂网| 捆绑紧缚一区二区三区视频| 成人手机电影网| 欧美美女激情18p| 日本一区二区三区在线观看| 性久久久久久久| 丁香啪啪综合成人亚洲小说| 欧美人体做爰大胆视频| 久久久激情视频| 视频在线观看91| 99久久精品一区| 久久综合99re88久久爱| 亚洲va欧美va人人爽午夜| 懂色av中文字幕一区二区三区| 欧美一区二区三区在线看| 中文字幕色av一区二区三区| 久久99精品久久久久| 在线精品国精品国产尤物884a| 国产午夜精品福利| 日韩va欧美va亚洲va久久| 色香色香欲天天天影视综合网| 久久这里都是精品| 蜜臀av一区二区在线观看| 欧美制服丝袜第一页| 国产精品成人免费精品自在线观看| 久久成人羞羞网站| 欧美一区二区三区免费观看视频| 亚洲欧美另类久久久精品| 国产一区二区免费在线| 69p69国产精品| 亚洲成人午夜电影| 色哦色哦哦色天天综合| 国产精品你懂的在线欣赏| 国产精品资源网| 欧美成人高清电影在线| 日韩经典一区二区| 欧美精品精品一区| 亚洲高清视频的网址| 在线免费一区三区| 亚洲免费在线观看| 91丝袜国产在线播放| 亚洲素人一区二区| 91麻豆精东视频| 亚洲色图另类专区| 色婷婷国产精品久久包臀| 亚洲视频在线观看三级| 91亚洲精品久久久蜜桃|