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

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

?? aescrypt.asm

?? 該文件屬于c++運行環境下AES加密程序源碼。
?? ASM
字號:

; -------------------------------------------------------------------------
; Copyright (c) 2001, Dr Brian Gladman <                 >, 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一区二区三区免费野_久草精品视频
欧美一区二区精品| 亚洲国产日日夜夜| 亚洲与欧洲av电影| 国产精品白丝jk黑袜喷水| 欧美日韩高清在线| 自拍偷拍国产精品| 成人永久看片免费视频天堂| 日韩一区二区在线播放| 一区二区三区鲁丝不卡| 成人国产精品免费观看| 精品国产第一区二区三区观看体验| 亚洲永久精品国产| 成人av在线播放网站| 久久久高清一区二区三区| 欧美a一区二区| 欧美日韩小视频| 亚洲夂夂婷婷色拍ww47| 色国产综合视频| 亚洲欧洲日本在线| 91一区一区三区| 亚洲高清一区二区三区| 色综合久久综合中文综合网| 国产精品国产三级国产三级人妇| 国产麻豆成人精品| 国产欧美一区二区精品性色| 韩国欧美国产1区| 精品91自产拍在线观看一区| 九色|91porny| 久久久久久97三级| 国产乱妇无码大片在线观看| 精品福利视频一区二区三区| 国产精品性做久久久久久| 国产亚洲欧美日韩在线一区| 丁香桃色午夜亚洲一区二区三区| 久久久精品中文字幕麻豆发布| 国内精品嫩模私拍在线| 国产欧美日韩激情| 99国产麻豆精品| 亚洲激情在线播放| 欧美在线制服丝袜| 日韩精品电影在线观看| 91精品国产综合久久久久久| 免费观看在线综合| 精品99999| 99热99精品| 日韩精品一卡二卡三卡四卡无卡| 日韩一级高清毛片| 国产精品一区在线观看乱码| 亚洲图片欧美激情| 在线成人免费观看| 国产一区二区三区av电影| 欧美国产成人在线| 欧美日韩中文字幕一区| 另类小说色综合网站| 中文字幕av免费专区久久| 色婷婷综合激情| 蜜桃久久精品一区二区| 国产婷婷色一区二区三区四区 | 欧美日本在线视频| 美腿丝袜亚洲色图| 日韩理论电影院| 欧美一区二区三区四区视频| 福利91精品一区二区三区| 亚洲免费观看视频| 日韩视频一区二区| 97久久精品人人爽人人爽蜜臀| 日韩中文字幕1| 国产农村妇女毛片精品久久麻豆 | 国产成人免费av在线| 亚洲欧美二区三区| 精品久久久影院| 在线日韩一区二区| 国产69精品久久久久毛片| 天天av天天翘天天综合网 | 国产真实精品久久二三区| 国产欧美一区二区精品性| 欧美日韩国产美女| 99这里都是精品| 久久黄色级2电影| 亚洲午夜激情网页| 国产精品色婷婷| 日韩一级二级三级| 精品视频一区 二区 三区| 成+人+亚洲+综合天堂| 日韩电影在线观看网站| 亚洲靠逼com| 国产精品三级视频| 26uuu精品一区二区在线观看| 欧美视频精品在线| 色综合婷婷久久| 粉嫩av亚洲一区二区图片| 美女视频免费一区| 日韩一区精品字幕| 亚洲成a人片在线观看中文| 国产精品私人影院| 久久久高清一区二区三区| 日韩一区二区三区高清免费看看| 在线一区二区观看| 色伊人久久综合中文字幕| 丁香激情综合国产| 国产成人精品www牛牛影视| 男女性色大片免费观看一区二区 | 亚洲激情图片一区| 欧美国产精品一区二区| 精品国产1区二区| 久久奇米777| 久久嫩草精品久久久精品| 欧美va日韩va| 2017欧美狠狠色| 精品国产髙清在线看国产毛片| 日韩丝袜美女视频| 日韩视频一区二区在线观看| 日韩一区和二区| 久久综合999| 国产视频不卡一区| 国产精品国产馆在线真实露脸| 国产欧美va欧美不卡在线| 国产精品家庭影院| 亚洲欧洲综合另类| 亚洲一二三区视频在线观看| 亚洲国产一区在线观看| 男男gaygay亚洲| 国产精选一区二区三区| 丁香婷婷综合激情五月色| 91色|porny| 7777女厕盗摄久久久| 欧美白人最猛性xxxxx69交| 2023国产精品| 中文字幕色av一区二区三区| 亚洲欧美日韩在线不卡| 亚洲国产精品视频| 看国产成人h片视频| 国产成人精品www牛牛影视| 91免费版在线| 91精品国产麻豆国产自产在线 | 国产99精品视频| 91欧美一区二区| 51精品国自产在线| 久久精品亚洲精品国产欧美| 亚洲欧美日韩精品久久久久| 亚洲成人免费在线观看| 国产自产高清不卡| 99精品视频在线观看| 在线播放中文一区| 中文字幕av不卡| 亚洲国产另类av| 国产黄色精品视频| 欧美探花视频资源| 久久网这里都是精品| 亚洲综合清纯丝袜自拍| 精品一区二区在线看| 成人激情动漫在线观看| 日本不卡一二三| 亚洲激情校园春色| 91久久精品一区二区三区| 欧美午夜宅男影院| 久久色成人在线| 亚洲国产wwwccc36天堂| 国产成人精品一区二区三区四区 | 欧美精品日韩一区| 国产精品久久久久久久久图文区 | 韩国成人精品a∨在线观看| 91蜜桃在线免费视频| 欧美精品一区二区久久久| 亚洲午夜三级在线| av在线一区二区三区| 精品国产一区二区三区久久影院| 樱桃国产成人精品视频| 韩国一区二区视频| 日韩一级片在线播放| 亚洲电影一区二区| 成人黄色一级视频| 久久久一区二区三区捆绑**| 天天色天天爱天天射综合| 色欧美片视频在线观看在线视频| 久久一区二区三区国产精品| 亚洲福利视频导航| 色视频一区二区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 亚洲国产日韩综合久久精品| 91小视频免费观看| 欧美激情一区二区| 国产精品18久久久久久久久久久久| 欧美日韩成人综合天天影院 | 欧洲精品视频在线观看| 国产精品久久久久aaaa| 国产精品一二三四五| 欧美成人伊人久久综合网| 日韩电影在线一区| 欧美夫妻性生活| 天天综合日日夜夜精品| 欧美日韩一区二区不卡| 亚洲一区免费在线观看| 色婷婷综合久色| 亚洲最色的网站| 欧美性生交片4| 天天综合日日夜夜精品| 日韩视频123| 国产又粗又猛又爽又黄91精品| 日韩欧美不卡一区|