CryptoPkg/OpensslLib: Commit the auto-generated assembly files for X64
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507 Adding the auto-generated assembly files for X64 architectures. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Xiaoyu Lu <xiaoyux.lu@intel.com> Cc: Mike Kinney <michael.d.kinney@intel.com> Cc: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Christopher Zurcher <christopher.zurcher@microsoft.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
878a92a887
commit
147f34b56c
732
CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-mb-x86_64.nasm
Normal file
732
CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-mb-x86_64.nasm
Normal file
@@ -0,0 +1,732 @@
|
||||
; WARNING: do not edit!
|
||||
; Generated from openssl/crypto/aes/asm/aesni-mb-x86_64.pl
|
||||
;
|
||||
; Copyright 2013-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
;
|
||||
; Licensed under the OpenSSL license (the "License"). You may not use
|
||||
; this file except in compliance with the License. You can obtain a copy
|
||||
; in the file LICENSE in the source distribution or at
|
||||
; https://www.openssl.org/source/license.html
|
||||
|
||||
default rel
|
||||
%define XMMWORD
|
||||
%define YMMWORD
|
||||
%define ZMMWORD
|
||||
section .text code align=64
|
||||
|
||||
|
||||
EXTERN OPENSSL_ia32cap_P
|
||||
|
||||
global aesni_multi_cbc_encrypt
|
||||
|
||||
ALIGN 32
|
||||
aesni_multi_cbc_encrypt:
|
||||
mov QWORD[8+rsp],rdi ;WIN64 prologue
|
||||
mov QWORD[16+rsp],rsi
|
||||
mov rax,rsp
|
||||
$L$SEH_begin_aesni_multi_cbc_encrypt:
|
||||
mov rdi,rcx
|
||||
mov rsi,rdx
|
||||
mov rdx,r8
|
||||
|
||||
|
||||
|
||||
mov rax,rsp
|
||||
|
||||
push rbx
|
||||
|
||||
push rbp
|
||||
|
||||
push r12
|
||||
|
||||
push r13
|
||||
|
||||
push r14
|
||||
|
||||
push r15
|
||||
|
||||
lea rsp,[((-168))+rsp]
|
||||
movaps XMMWORD[rsp],xmm6
|
||||
movaps XMMWORD[16+rsp],xmm7
|
||||
movaps XMMWORD[32+rsp],xmm8
|
||||
movaps XMMWORD[48+rsp],xmm9
|
||||
movaps XMMWORD[64+rsp],xmm10
|
||||
movaps XMMWORD[80+rsp],xmm11
|
||||
movaps XMMWORD[96+rsp],xmm12
|
||||
movaps XMMWORD[(-104)+rax],xmm13
|
||||
movaps XMMWORD[(-88)+rax],xmm14
|
||||
movaps XMMWORD[(-72)+rax],xmm15
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sub rsp,48
|
||||
and rsp,-64
|
||||
mov QWORD[16+rsp],rax
|
||||
|
||||
|
||||
$L$enc4x_body:
|
||||
movdqu xmm12,XMMWORD[rsi]
|
||||
lea rsi,[120+rsi]
|
||||
lea rdi,[80+rdi]
|
||||
|
||||
$L$enc4x_loop_grande:
|
||||
mov DWORD[24+rsp],edx
|
||||
xor edx,edx
|
||||
mov ecx,DWORD[((-64))+rdi]
|
||||
mov r8,QWORD[((-80))+rdi]
|
||||
cmp ecx,edx
|
||||
mov r12,QWORD[((-72))+rdi]
|
||||
cmovg edx,ecx
|
||||
test ecx,ecx
|
||||
movdqu xmm2,XMMWORD[((-56))+rdi]
|
||||
mov DWORD[32+rsp],ecx
|
||||
cmovle r8,rsp
|
||||
mov ecx,DWORD[((-24))+rdi]
|
||||
mov r9,QWORD[((-40))+rdi]
|
||||
cmp ecx,edx
|
||||
mov r13,QWORD[((-32))+rdi]
|
||||
cmovg edx,ecx
|
||||
test ecx,ecx
|
||||
movdqu xmm3,XMMWORD[((-16))+rdi]
|
||||
mov DWORD[36+rsp],ecx
|
||||
cmovle r9,rsp
|
||||
mov ecx,DWORD[16+rdi]
|
||||
mov r10,QWORD[rdi]
|
||||
cmp ecx,edx
|
||||
mov r14,QWORD[8+rdi]
|
||||
cmovg edx,ecx
|
||||
test ecx,ecx
|
||||
movdqu xmm4,XMMWORD[24+rdi]
|
||||
mov DWORD[40+rsp],ecx
|
||||
cmovle r10,rsp
|
||||
mov ecx,DWORD[56+rdi]
|
||||
mov r11,QWORD[40+rdi]
|
||||
cmp ecx,edx
|
||||
mov r15,QWORD[48+rdi]
|
||||
cmovg edx,ecx
|
||||
test ecx,ecx
|
||||
movdqu xmm5,XMMWORD[64+rdi]
|
||||
mov DWORD[44+rsp],ecx
|
||||
cmovle r11,rsp
|
||||
test edx,edx
|
||||
jz NEAR $L$enc4x_done
|
||||
|
||||
movups xmm1,XMMWORD[((16-120))+rsi]
|
||||
pxor xmm2,xmm12
|
||||
movups xmm0,XMMWORD[((32-120))+rsi]
|
||||
pxor xmm3,xmm12
|
||||
mov eax,DWORD[((240-120))+rsi]
|
||||
pxor xmm4,xmm12
|
||||
movdqu xmm6,XMMWORD[r8]
|
||||
pxor xmm5,xmm12
|
||||
movdqu xmm7,XMMWORD[r9]
|
||||
pxor xmm2,xmm6
|
||||
movdqu xmm8,XMMWORD[r10]
|
||||
pxor xmm3,xmm7
|
||||
movdqu xmm9,XMMWORD[r11]
|
||||
pxor xmm4,xmm8
|
||||
pxor xmm5,xmm9
|
||||
movdqa xmm10,XMMWORD[32+rsp]
|
||||
xor rbx,rbx
|
||||
jmp NEAR $L$oop_enc4x
|
||||
|
||||
ALIGN 32
|
||||
$L$oop_enc4x:
|
||||
add rbx,16
|
||||
lea rbp,[16+rsp]
|
||||
mov ecx,1
|
||||
sub rbp,rbx
|
||||
|
||||
DB 102,15,56,220,209
|
||||
prefetcht0 [31+rbx*1+r8]
|
||||
prefetcht0 [31+rbx*1+r9]
|
||||
DB 102,15,56,220,217
|
||||
prefetcht0 [31+rbx*1+r10]
|
||||
prefetcht0 [31+rbx*1+r10]
|
||||
DB 102,15,56,220,225
|
||||
DB 102,15,56,220,233
|
||||
movups xmm1,XMMWORD[((48-120))+rsi]
|
||||
cmp ecx,DWORD[32+rsp]
|
||||
DB 102,15,56,220,208
|
||||
DB 102,15,56,220,216
|
||||
DB 102,15,56,220,224
|
||||
cmovge r8,rbp
|
||||
cmovg r12,rbp
|
||||
DB 102,15,56,220,232
|
||||
movups xmm0,XMMWORD[((-56))+rsi]
|
||||
cmp ecx,DWORD[36+rsp]
|
||||
DB 102,15,56,220,209
|
||||
DB 102,15,56,220,217
|
||||
DB 102,15,56,220,225
|
||||
cmovge r9,rbp
|
||||
cmovg r13,rbp
|
||||
DB 102,15,56,220,233
|
||||
movups xmm1,XMMWORD[((-40))+rsi]
|
||||
cmp ecx,DWORD[40+rsp]
|
||||
DB 102,15,56,220,208
|
||||
DB 102,15,56,220,216
|
||||
DB 102,15,56,220,224
|
||||
cmovge r10,rbp
|
||||
cmovg r14,rbp
|
||||
DB 102,15,56,220,232
|
||||
movups xmm0,XMMWORD[((-24))+rsi]
|
||||
cmp ecx,DWORD[44+rsp]
|
||||
DB 102,15,56,220,209
|
||||
DB 102,15,56,220,217
|
||||
DB 102,15,56,220,225
|
||||
cmovge r11,rbp
|
||||
cmovg r15,rbp
|
||||
DB 102,15,56,220,233
|
||||
movups xmm1,XMMWORD[((-8))+rsi]
|
||||
movdqa xmm11,xmm10
|
||||
DB 102,15,56,220,208
|
||||
prefetcht0 [15+rbx*1+r12]
|
||||
prefetcht0 [15+rbx*1+r13]
|
||||
DB 102,15,56,220,216
|
||||
prefetcht0 [15+rbx*1+r14]
|
||||
prefetcht0 [15+rbx*1+r15]
|
||||
DB 102,15,56,220,224
|
||||
DB 102,15,56,220,232
|
||||
movups xmm0,XMMWORD[((128-120))+rsi]
|
||||
pxor xmm12,xmm12
|
||||
|
||||
DB 102,15,56,220,209
|
||||
pcmpgtd xmm11,xmm12
|
||||
movdqu xmm12,XMMWORD[((-120))+rsi]
|
||||
DB 102,15,56,220,217
|
||||
paddd xmm10,xmm11
|
||||
movdqa XMMWORD[32+rsp],xmm10
|
||||
DB 102,15,56,220,225
|
||||
DB 102,15,56,220,233
|
||||
movups xmm1,XMMWORD[((144-120))+rsi]
|
||||
|
||||
cmp eax,11
|
||||
|
||||
DB 102,15,56,220,208
|
||||
DB 102,15,56,220,216
|
||||
DB 102,15,56,220,224
|
||||
DB 102,15,56,220,232
|
||||
movups xmm0,XMMWORD[((160-120))+rsi]
|
||||
|
||||
jb NEAR $L$enc4x_tail
|
||||
|
||||
DB 102,15,56,220,209
|
||||
DB 102,15,56,220,217
|
||||
DB 102,15,56,220,225
|
||||
DB 102,15,56,220,233
|
||||
movups xmm1,XMMWORD[((176-120))+rsi]
|
||||
|
||||
DB 102,15,56,220,208
|
||||
DB 102,15,56,220,216
|
||||
DB 102,15,56,220,224
|
||||
DB 102,15,56,220,232
|
||||
movups xmm0,XMMWORD[((192-120))+rsi]
|
||||
|
||||
je NEAR $L$enc4x_tail
|
||||
|
||||
DB 102,15,56,220,209
|
||||
DB 102,15,56,220,217
|
||||
DB 102,15,56,220,225
|
||||
DB 102,15,56,220,233
|
||||
movups xmm1,XMMWORD[((208-120))+rsi]
|
||||
|
||||
DB 102,15,56,220,208
|
||||
DB 102,15,56,220,216
|
||||
DB 102,15,56,220,224
|
||||
DB 102,15,56,220,232
|
||||
movups xmm0,XMMWORD[((224-120))+rsi]
|
||||
jmp NEAR $L$enc4x_tail
|
||||
|
||||
ALIGN 32
|
||||
$L$enc4x_tail:
|
||||
DB 102,15,56,220,209
|
||||
DB 102,15,56,220,217
|
||||
DB 102,15,56,220,225
|
||||
DB 102,15,56,220,233
|
||||
movdqu xmm6,XMMWORD[rbx*1+r8]
|
||||
movdqu xmm1,XMMWORD[((16-120))+rsi]
|
||||
|
||||
DB 102,15,56,221,208
|
||||
movdqu xmm7,XMMWORD[rbx*1+r9]
|
||||
pxor xmm6,xmm12
|
||||
DB 102,15,56,221,216
|
||||
movdqu xmm8,XMMWORD[rbx*1+r10]
|
||||
pxor xmm7,xmm12
|
||||
DB 102,15,56,221,224
|
||||
movdqu xmm9,XMMWORD[rbx*1+r11]
|
||||
pxor xmm8,xmm12
|
||||
DB 102,15,56,221,232
|
||||
movdqu xmm0,XMMWORD[((32-120))+rsi]
|
||||
pxor xmm9,xmm12
|
||||
|
||||
movups XMMWORD[(-16)+rbx*1+r12],xmm2
|
||||
pxor xmm2,xmm6
|
||||
movups XMMWORD[(-16)+rbx*1+r13],xmm3
|
||||
pxor xmm3,xmm7
|
||||
movups XMMWORD[(-16)+rbx*1+r14],xmm4
|
||||
pxor xmm4,xmm8
|
||||
movups XMMWORD[(-16)+rbx*1+r15],xmm5
|
||||
pxor xmm5,xmm9
|
||||
|
||||
dec edx
|
||||
jnz NEAR $L$oop_enc4x
|
||||
|
||||
mov rax,QWORD[16+rsp]
|
||||
|
||||
mov edx,DWORD[24+rsp]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
lea rdi,[160+rdi]
|
||||
dec edx
|
||||
jnz NEAR $L$enc4x_loop_grande
|
||||
|
||||
$L$enc4x_done:
|
||||
movaps xmm6,XMMWORD[((-216))+rax]
|
||||
movaps xmm7,XMMWORD[((-200))+rax]
|
||||
movaps xmm8,XMMWORD[((-184))+rax]
|
||||
movaps xmm9,XMMWORD[((-168))+rax]
|
||||
movaps xmm10,XMMWORD[((-152))+rax]
|
||||
movaps xmm11,XMMWORD[((-136))+rax]
|
||||
movaps xmm12,XMMWORD[((-120))+rax]
|
||||
|
||||
|
||||
|
||||
mov r15,QWORD[((-48))+rax]
|
||||
|
||||
mov r14,QWORD[((-40))+rax]
|
||||
|
||||
mov r13,QWORD[((-32))+rax]
|
||||
|
||||
mov r12,QWORD[((-24))+rax]
|
||||
|
||||
mov rbp,QWORD[((-16))+rax]
|
||||
|
||||
mov rbx,QWORD[((-8))+rax]
|
||||
|
||||
lea rsp,[rax]
|
||||
|
||||
$L$enc4x_epilogue:
|
||||
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
||||
mov rsi,QWORD[16+rsp]
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
$L$SEH_end_aesni_multi_cbc_encrypt:
|
||||
|
||||
global aesni_multi_cbc_decrypt
|
||||
|
||||
ALIGN 32
|
||||
aesni_multi_cbc_decrypt:
|
||||
mov QWORD[8+rsp],rdi ;WIN64 prologue
|
||||
mov QWORD[16+rsp],rsi
|
||||
mov rax,rsp
|
||||
$L$SEH_begin_aesni_multi_cbc_decrypt:
|
||||
mov rdi,rcx
|
||||
mov rsi,rdx
|
||||
mov rdx,r8
|
||||
|
||||
|
||||
|
||||
mov rax,rsp
|
||||
|
||||
push rbx
|
||||
|
||||
push rbp
|
||||
|
||||
push r12
|
||||
|
||||
push r13
|
||||
|
||||
push r14
|
||||
|
||||
push r15
|
||||
|
||||
lea rsp,[((-168))+rsp]
|
||||
movaps XMMWORD[rsp],xmm6
|
||||
movaps XMMWORD[16+rsp],xmm7
|
||||
movaps XMMWORD[32+rsp],xmm8
|
||||
movaps XMMWORD[48+rsp],xmm9
|
||||
movaps XMMWORD[64+rsp],xmm10
|
||||
movaps XMMWORD[80+rsp],xmm11
|
||||
movaps XMMWORD[96+rsp],xmm12
|
||||
movaps XMMWORD[(-104)+rax],xmm13
|
||||
movaps XMMWORD[(-88)+rax],xmm14
|
||||
movaps XMMWORD[(-72)+rax],xmm15
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sub rsp,48
|
||||
and rsp,-64
|
||||
mov QWORD[16+rsp],rax
|
||||
|
||||
|
||||
$L$dec4x_body:
|
||||
movdqu xmm12,XMMWORD[rsi]
|
||||
lea rsi,[120+rsi]
|
||||
lea rdi,[80+rdi]
|
||||
|
||||
$L$dec4x_loop_grande:
|
||||
mov DWORD[24+rsp],edx
|
||||
xor edx,edx
|
||||
mov ecx,DWORD[((-64))+rdi]
|
||||
mov r8,QWORD[((-80))+rdi]
|
||||
cmp ecx,edx
|
||||
mov r12,QWORD[((-72))+rdi]
|
||||
cmovg edx,ecx
|
||||
test ecx,ecx
|
||||
movdqu xmm6,XMMWORD[((-56))+rdi]
|
||||
mov DWORD[32+rsp],ecx
|
||||
cmovle r8,rsp
|
||||
mov ecx,DWORD[((-24))+rdi]
|
||||
mov r9,QWORD[((-40))+rdi]
|
||||
cmp ecx,edx
|
||||
mov r13,QWORD[((-32))+rdi]
|
||||
cmovg edx,ecx
|
||||
test ecx,ecx
|
||||
movdqu xmm7,XMMWORD[((-16))+rdi]
|
||||
mov DWORD[36+rsp],ecx
|
||||
cmovle r9,rsp
|
||||
mov ecx,DWORD[16+rdi]
|
||||
mov r10,QWORD[rdi]
|
||||
cmp ecx,edx
|
||||
mov r14,QWORD[8+rdi]
|
||||
cmovg edx,ecx
|
||||
test ecx,ecx
|
||||
movdqu xmm8,XMMWORD[24+rdi]
|
||||
mov DWORD[40+rsp],ecx
|
||||
cmovle r10,rsp
|
||||
mov ecx,DWORD[56+rdi]
|
||||
mov r11,QWORD[40+rdi]
|
||||
cmp ecx,edx
|
||||
mov r15,QWORD[48+rdi]
|
||||
cmovg edx,ecx
|
||||
test ecx,ecx
|
||||
movdqu xmm9,XMMWORD[64+rdi]
|
||||
mov DWORD[44+rsp],ecx
|
||||
cmovle r11,rsp
|
||||
test edx,edx
|
||||
jz NEAR $L$dec4x_done
|
||||
|
||||
movups xmm1,XMMWORD[((16-120))+rsi]
|
||||
movups xmm0,XMMWORD[((32-120))+rsi]
|
||||
mov eax,DWORD[((240-120))+rsi]
|
||||
movdqu xmm2,XMMWORD[r8]
|
||||
movdqu xmm3,XMMWORD[r9]
|
||||
pxor xmm2,xmm12
|
||||
movdqu xmm4,XMMWORD[r10]
|
||||
pxor xmm3,xmm12
|
||||
movdqu xmm5,XMMWORD[r11]
|
||||
pxor xmm4,xmm12
|
||||
pxor xmm5,xmm12
|
||||
movdqa xmm10,XMMWORD[32+rsp]
|
||||
xor rbx,rbx
|
||||
jmp NEAR $L$oop_dec4x
|
||||
|
||||
ALIGN 32
|
||||
$L$oop_dec4x:
|
||||
add rbx,16
|
||||
lea rbp,[16+rsp]
|
||||
mov ecx,1
|
||||
sub rbp,rbx
|
||||
|
||||
DB 102,15,56,222,209
|
||||
prefetcht0 [31+rbx*1+r8]
|
||||
prefetcht0 [31+rbx*1+r9]
|
||||
DB 102,15,56,222,217
|
||||
prefetcht0 [31+rbx*1+r10]
|
||||
prefetcht0 [31+rbx*1+r11]
|
||||
DB 102,15,56,222,225
|
||||
DB 102,15,56,222,233
|
||||
movups xmm1,XMMWORD[((48-120))+rsi]
|
||||
cmp ecx,DWORD[32+rsp]
|
||||
DB 102,15,56,222,208
|
||||
DB 102,15,56,222,216
|
||||
DB 102,15,56,222,224
|
||||
cmovge r8,rbp
|
||||
cmovg r12,rbp
|
||||
DB 102,15,56,222,232
|
||||
movups xmm0,XMMWORD[((-56))+rsi]
|
||||
cmp ecx,DWORD[36+rsp]
|
||||
DB 102,15,56,222,209
|
||||
DB 102,15,56,222,217
|
||||
DB 102,15,56,222,225
|
||||
cmovge r9,rbp
|
||||
cmovg r13,rbp
|
||||
DB 102,15,56,222,233
|
||||
movups xmm1,XMMWORD[((-40))+rsi]
|
||||
cmp ecx,DWORD[40+rsp]
|
||||
DB 102,15,56,222,208
|
||||
DB 102,15,56,222,216
|
||||
DB 102,15,56,222,224
|
||||
cmovge r10,rbp
|
||||
cmovg r14,rbp
|
||||
DB 102,15,56,222,232
|
||||
movups xmm0,XMMWORD[((-24))+rsi]
|
||||
cmp ecx,DWORD[44+rsp]
|
||||
DB 102,15,56,222,209
|
||||
DB 102,15,56,222,217
|
||||
DB 102,15,56,222,225
|
||||
cmovge r11,rbp
|
||||
cmovg r15,rbp
|
||||
DB 102,15,56,222,233
|
||||
movups xmm1,XMMWORD[((-8))+rsi]
|
||||
movdqa xmm11,xmm10
|
||||
DB 102,15,56,222,208
|
||||
prefetcht0 [15+rbx*1+r12]
|
||||
prefetcht0 [15+rbx*1+r13]
|
||||
DB 102,15,56,222,216
|
||||
prefetcht0 [15+rbx*1+r14]
|
||||
prefetcht0 [15+rbx*1+r15]
|
||||
DB 102,15,56,222,224
|
||||
DB 102,15,56,222,232
|
||||
movups xmm0,XMMWORD[((128-120))+rsi]
|
||||
pxor xmm12,xmm12
|
||||
|
||||
DB 102,15,56,222,209
|
||||
pcmpgtd xmm11,xmm12
|
||||
movdqu xmm12,XMMWORD[((-120))+rsi]
|
||||
DB 102,15,56,222,217
|
||||
paddd xmm10,xmm11
|
||||
movdqa XMMWORD[32+rsp],xmm10
|
||||
DB 102,15,56,222,225
|
||||
DB 102,15,56,222,233
|
||||
movups xmm1,XMMWORD[((144-120))+rsi]
|
||||
|
||||
cmp eax,11
|
||||
|
||||
DB 102,15,56,222,208
|
||||
DB 102,15,56,222,216
|
||||
DB 102,15,56,222,224
|
||||
DB 102,15,56,222,232
|
||||
movups xmm0,XMMWORD[((160-120))+rsi]
|
||||
|
||||
jb NEAR $L$dec4x_tail
|
||||
|
||||
DB 102,15,56,222,209
|
||||
DB 102,15,56,222,217
|
||||
DB 102,15,56,222,225
|
||||
DB 102,15,56,222,233
|
||||
movups xmm1,XMMWORD[((176-120))+rsi]
|
||||
|
||||
DB 102,15,56,222,208
|
||||
DB 102,15,56,222,216
|
||||
DB 102,15,56,222,224
|
||||
DB 102,15,56,222,232
|
||||
movups xmm0,XMMWORD[((192-120))+rsi]
|
||||
|
||||
je NEAR $L$dec4x_tail
|
||||
|
||||
DB 102,15,56,222,209
|
||||
DB 102,15,56,222,217
|
||||
DB 102,15,56,222,225
|
||||
DB 102,15,56,222,233
|
||||
movups xmm1,XMMWORD[((208-120))+rsi]
|
||||
|
||||
DB 102,15,56,222,208
|
||||
DB 102,15,56,222,216
|
||||
DB 102,15,56,222,224
|
||||
DB 102,15,56,222,232
|
||||
movups xmm0,XMMWORD[((224-120))+rsi]
|
||||
jmp NEAR $L$dec4x_tail
|
||||
|
||||
ALIGN 32
|
||||
$L$dec4x_tail:
|
||||
DB 102,15,56,222,209
|
||||
DB 102,15,56,222,217
|
||||
DB 102,15,56,222,225
|
||||
pxor xmm6,xmm0
|
||||
pxor xmm7,xmm0
|
||||
DB 102,15,56,222,233
|
||||
movdqu xmm1,XMMWORD[((16-120))+rsi]
|
||||
pxor xmm8,xmm0
|
||||
pxor xmm9,xmm0
|
||||
movdqu xmm0,XMMWORD[((32-120))+rsi]
|
||||
|
||||
DB 102,15,56,223,214
|
||||
DB 102,15,56,223,223
|
||||
movdqu xmm6,XMMWORD[((-16))+rbx*1+r8]
|
||||
movdqu xmm7,XMMWORD[((-16))+rbx*1+r9]
|
||||
DB 102,65,15,56,223,224
|
||||
DB 102,65,15,56,223,233
|
||||
movdqu xmm8,XMMWORD[((-16))+rbx*1+r10]
|
||||
movdqu xmm9,XMMWORD[((-16))+rbx*1+r11]
|
||||
|
||||
movups XMMWORD[(-16)+rbx*1+r12],xmm2
|
||||
movdqu xmm2,XMMWORD[rbx*1+r8]
|
||||
movups XMMWORD[(-16)+rbx*1+r13],xmm3
|
||||
movdqu xmm3,XMMWORD[rbx*1+r9]
|
||||
pxor xmm2,xmm12
|
||||
movups XMMWORD[(-16)+rbx*1+r14],xmm4
|
||||
movdqu xmm4,XMMWORD[rbx*1+r10]
|
||||
pxor xmm3,xmm12
|
||||
movups XMMWORD[(-16)+rbx*1+r15],xmm5
|
||||
movdqu xmm5,XMMWORD[rbx*1+r11]
|
||||
pxor xmm4,xmm12
|
||||
pxor xmm5,xmm12
|
||||
|
||||
dec edx
|
||||
jnz NEAR $L$oop_dec4x
|
||||
|
||||
mov rax,QWORD[16+rsp]
|
||||
|
||||
mov edx,DWORD[24+rsp]
|
||||
|
||||
lea rdi,[160+rdi]
|
||||
dec edx
|
||||
jnz NEAR $L$dec4x_loop_grande
|
||||
|
||||
$L$dec4x_done:
|
||||
movaps xmm6,XMMWORD[((-216))+rax]
|
||||
movaps xmm7,XMMWORD[((-200))+rax]
|
||||
movaps xmm8,XMMWORD[((-184))+rax]
|
||||
movaps xmm9,XMMWORD[((-168))+rax]
|
||||
movaps xmm10,XMMWORD[((-152))+rax]
|
||||
movaps xmm11,XMMWORD[((-136))+rax]
|
||||
movaps xmm12,XMMWORD[((-120))+rax]
|
||||
|
||||
|
||||
|
||||
mov r15,QWORD[((-48))+rax]
|
||||
|
||||
mov r14,QWORD[((-40))+rax]
|
||||
|
||||
mov r13,QWORD[((-32))+rax]
|
||||
|
||||
mov r12,QWORD[((-24))+rax]
|
||||
|
||||
mov rbp,QWORD[((-16))+rax]
|
||||
|
||||
mov rbx,QWORD[((-8))+rax]
|
||||
|
||||
lea rsp,[rax]
|
||||
|
||||
$L$dec4x_epilogue:
|
||||
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
||||
mov rsi,QWORD[16+rsp]
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
$L$SEH_end_aesni_multi_cbc_decrypt:
|
||||
EXTERN __imp_RtlVirtualUnwind
|
||||
|
||||
ALIGN 16
|
||||
se_handler:
|
||||
push rsi
|
||||
push rdi
|
||||
push rbx
|
||||
push rbp
|
||||
push r12
|
||||
push r13
|
||||
push r14
|
||||
push r15
|
||||
pushfq
|
||||
sub rsp,64
|
||||
|
||||
mov rax,QWORD[120+r8]
|
||||
mov rbx,QWORD[248+r8]
|
||||
|
||||
mov rsi,QWORD[8+r9]
|
||||
mov r11,QWORD[56+r9]
|
||||
|
||||
mov r10d,DWORD[r11]
|
||||
lea r10,[r10*1+rsi]
|
||||
cmp rbx,r10
|
||||
jb NEAR $L$in_prologue
|
||||
|
||||
mov rax,QWORD[152+r8]
|
||||
|
||||
mov r10d,DWORD[4+r11]
|
||||
lea r10,[r10*1+rsi]
|
||||
cmp rbx,r10
|
||||
jae NEAR $L$in_prologue
|
||||
|
||||
mov rax,QWORD[16+rax]
|
||||
|
||||
mov rbx,QWORD[((-8))+rax]
|
||||
mov rbp,QWORD[((-16))+rax]
|
||||
mov r12,QWORD[((-24))+rax]
|
||||
mov r13,QWORD[((-32))+rax]
|
||||
mov r14,QWORD[((-40))+rax]
|
||||
mov r15,QWORD[((-48))+rax]
|
||||
mov QWORD[144+r8],rbx
|
||||
mov QWORD[160+r8],rbp
|
||||
mov QWORD[216+r8],r12
|
||||
mov QWORD[224+r8],r13
|
||||
mov QWORD[232+r8],r14
|
||||
mov QWORD[240+r8],r15
|
||||
|
||||
lea rsi,[((-56-160))+rax]
|
||||
lea rdi,[512+r8]
|
||||
mov ecx,20
|
||||
DD 0xa548f3fc
|
||||
|
||||
$L$in_prologue:
|
||||
mov rdi,QWORD[8+rax]
|
||||
mov rsi,QWORD[16+rax]
|
||||
mov QWORD[152+r8],rax
|
||||
mov QWORD[168+r8],rsi
|
||||
mov QWORD[176+r8],rdi
|
||||
|
||||
mov rdi,QWORD[40+r9]
|
||||
mov rsi,r8
|
||||
mov ecx,154
|
||||
DD 0xa548f3fc
|
||||
|
||||
mov rsi,r9
|
||||
xor rcx,rcx
|
||||
mov rdx,QWORD[8+rsi]
|
||||
mov r8,QWORD[rsi]
|
||||
mov r9,QWORD[16+rsi]
|
||||
mov r10,QWORD[40+rsi]
|
||||
lea r11,[56+rsi]
|
||||
lea r12,[24+rsi]
|
||||
mov QWORD[32+rsp],r10
|
||||
mov QWORD[40+rsp],r11
|
||||
mov QWORD[48+rsp],r12
|
||||
mov QWORD[56+rsp],rcx
|
||||
call QWORD[__imp_RtlVirtualUnwind]
|
||||
|
||||
mov eax,1
|
||||
add rsp,64
|
||||
popfq
|
||||
pop r15
|
||||
pop r14
|
||||
pop r13
|
||||
pop r12
|
||||
pop rbp
|
||||
pop rbx
|
||||
pop rdi
|
||||
pop rsi
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
section .pdata rdata align=4
|
||||
ALIGN 4
|
||||
DD $L$SEH_begin_aesni_multi_cbc_encrypt wrt ..imagebase
|
||||
DD $L$SEH_end_aesni_multi_cbc_encrypt wrt ..imagebase
|
||||
DD $L$SEH_info_aesni_multi_cbc_encrypt wrt ..imagebase
|
||||
DD $L$SEH_begin_aesni_multi_cbc_decrypt wrt ..imagebase
|
||||
DD $L$SEH_end_aesni_multi_cbc_decrypt wrt ..imagebase
|
||||
DD $L$SEH_info_aesni_multi_cbc_decrypt wrt ..imagebase
|
||||
section .xdata rdata align=8
|
||||
ALIGN 8
|
||||
$L$SEH_info_aesni_multi_cbc_encrypt:
|
||||
DB 9,0,0,0
|
||||
DD se_handler wrt ..imagebase
|
||||
DD $L$enc4x_body wrt ..imagebase,$L$enc4x_epilogue wrt ..imagebase
|
||||
$L$SEH_info_aesni_multi_cbc_decrypt:
|
||||
DB 9,0,0,0
|
||||
DD se_handler wrt ..imagebase
|
||||
DD $L$dec4x_body wrt ..imagebase,$L$dec4x_epilogue wrt ..imagebase
|
1916
CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-sha1-x86_64.nasm
Normal file
1916
CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-sha1-x86_64.nasm
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,78 @@
|
||||
; WARNING: do not edit!
|
||||
; Generated from openssl/crypto/aes/asm/aesni-sha256-x86_64.pl
|
||||
;
|
||||
; Copyright 2013-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
;
|
||||
; Licensed under the OpenSSL license (the "License"). You may not use
|
||||
; this file except in compliance with the License. You can obtain a copy
|
||||
; in the file LICENSE in the source distribution or at
|
||||
; https://www.openssl.org/source/license.html
|
||||
|
||||
default rel
|
||||
%define XMMWORD
|
||||
%define YMMWORD
|
||||
%define ZMMWORD
|
||||
section .text code align=64
|
||||
|
||||
|
||||
EXTERN OPENSSL_ia32cap_P
|
||||
global aesni_cbc_sha256_enc
|
||||
|
||||
ALIGN 16
|
||||
aesni_cbc_sha256_enc:
|
||||
|
||||
xor eax,eax
|
||||
cmp rcx,0
|
||||
je NEAR $L$probe
|
||||
ud2
|
||||
$L$probe:
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
|
||||
ALIGN 64
|
||||
|
||||
K256:
|
||||
DD 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
|
||||
DD 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
|
||||
DD 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
|
||||
DD 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
|
||||
DD 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
|
||||
DD 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
|
||||
DD 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
|
||||
DD 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
|
||||
DD 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
|
||||
DD 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
|
||||
DD 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
|
||||
DD 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
|
||||
DD 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
|
||||
DD 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
|
||||
DD 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
|
||||
DD 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
|
||||
DD 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
|
||||
DD 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
|
||||
DD 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
|
||||
DD 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
|
||||
DD 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
|
||||
DD 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
|
||||
DD 0xd192e819,0xd6990624,0xf40e3585,0x106aa070
|
||||
DD 0xd192e819,0xd6990624,0xf40e3585,0x106aa070
|
||||
DD 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
|
||||
DD 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
|
||||
DD 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
|
||||
DD 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
|
||||
DD 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
|
||||
DD 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
|
||||
DD 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
|
||||
DD 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
|
||||
|
||||
DD 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
|
||||
DD 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
|
||||
DD 0,0,0,0,0,0,0,0,-1,-1,-1,-1
|
||||
DD 0,0,0,0,0,0,0,0
|
||||
DB 65,69,83,78,73,45,67,66,67,43,83,72,65,50,53,54
|
||||
DB 32,115,116,105,116,99,104,32,102,111,114,32,120,56,54,95
|
||||
DB 54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98
|
||||
DB 121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108
|
||||
DB 46,111,114,103,62,0
|
||||
ALIGN 64
|
5103
CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-x86_64.nasm
Normal file
5103
CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-x86_64.nasm
Normal file
File diff suppressed because it is too large
Load Diff
1173
CryptoPkg/Library/OpensslLib/X64/crypto/aes/vpaes-x86_64.nasm
Normal file
1173
CryptoPkg/Library/OpensslLib/X64/crypto/aes/vpaes-x86_64.nasm
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
; WARNING: do not edit!
|
||||
; Generated from openssl/crypto/modes/asm/aesni-gcm-x86_64.pl
|
||||
;
|
||||
; Copyright 2013-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
;
|
||||
; Licensed under the OpenSSL license (the "License"). You may not use
|
||||
; this file except in compliance with the License. You can obtain a copy
|
||||
; in the file LICENSE in the source distribution or at
|
||||
; https://www.openssl.org/source/license.html
|
||||
|
||||
default rel
|
||||
%define XMMWORD
|
||||
%define YMMWORD
|
||||
%define ZMMWORD
|
||||
section .text code align=64
|
||||
|
||||
|
||||
global aesni_gcm_encrypt
|
||||
|
||||
aesni_gcm_encrypt:
|
||||
|
||||
xor eax,eax
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
|
||||
global aesni_gcm_decrypt
|
||||
|
||||
aesni_gcm_decrypt:
|
||||
|
||||
xor eax,eax
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
1569
CryptoPkg/Library/OpensslLib/X64/crypto/modes/ghash-x86_64.nasm
Normal file
1569
CryptoPkg/Library/OpensslLib/X64/crypto/modes/ghash-x86_64.nasm
Normal file
File diff suppressed because it is too large
Load Diff
3137
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha1-mb-x86_64.nasm
Normal file
3137
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha1-mb-x86_64.nasm
Normal file
File diff suppressed because it is too large
Load Diff
2884
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha1-x86_64.nasm
Normal file
2884
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha1-x86_64.nasm
Normal file
File diff suppressed because it is too large
Load Diff
3461
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha256-mb-x86_64.nasm
Normal file
3461
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha256-mb-x86_64.nasm
Normal file
File diff suppressed because it is too large
Load Diff
3313
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha256-x86_64.nasm
Normal file
3313
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha256-x86_64.nasm
Normal file
File diff suppressed because it is too large
Load Diff
1938
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha512-x86_64.nasm
Normal file
1938
CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha512-x86_64.nasm
Normal file
File diff suppressed because it is too large
Load Diff
491
CryptoPkg/Library/OpensslLib/X64/crypto/x86_64cpuid.nasm
Normal file
491
CryptoPkg/Library/OpensslLib/X64/crypto/x86_64cpuid.nasm
Normal file
@@ -0,0 +1,491 @@
|
||||
; WARNING: do not edit!
|
||||
; Generated from openssl/crypto/x86_64cpuid.pl
|
||||
;
|
||||
; Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
;
|
||||
; Licensed under the OpenSSL license (the "License"). You may not use
|
||||
; this file except in compliance with the License. You can obtain a copy
|
||||
; in the file LICENSE in the source distribution or at
|
||||
; https://www.openssl.org/source/license.html
|
||||
|
||||
default rel
|
||||
%define XMMWORD
|
||||
%define YMMWORD
|
||||
%define ZMMWORD
|
||||
EXTERN OPENSSL_cpuid_setup
|
||||
|
||||
section .CRT$XCU rdata align=8
|
||||
DQ OPENSSL_cpuid_setup
|
||||
|
||||
|
||||
common OPENSSL_ia32cap_P 16
|
||||
|
||||
section .text code align=64
|
||||
|
||||
|
||||
global OPENSSL_atomic_add
|
||||
|
||||
ALIGN 16
|
||||
OPENSSL_atomic_add:
|
||||
|
||||
mov eax,DWORD[rcx]
|
||||
$L$spin: lea r8,[rax*1+rdx]
|
||||
DB 0xf0
|
||||
cmpxchg DWORD[rcx],r8d
|
||||
jne NEAR $L$spin
|
||||
mov eax,r8d
|
||||
DB 0x48,0x98
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
|
||||
global OPENSSL_rdtsc
|
||||
|
||||
ALIGN 16
|
||||
OPENSSL_rdtsc:
|
||||
|
||||
rdtsc
|
||||
shl rdx,32
|
||||
or rax,rdx
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
|
||||
global OPENSSL_ia32_cpuid
|
||||
|
||||
ALIGN 16
|
||||
OPENSSL_ia32_cpuid:
|
||||
mov QWORD[8+rsp],rdi ;WIN64 prologue
|
||||
mov QWORD[16+rsp],rsi
|
||||
mov rax,rsp
|
||||
$L$SEH_begin_OPENSSL_ia32_cpuid:
|
||||
mov rdi,rcx
|
||||
|
||||
|
||||
|
||||
mov r8,rbx
|
||||
|
||||
|
||||
xor eax,eax
|
||||
mov QWORD[8+rdi],rax
|
||||
cpuid
|
||||
mov r11d,eax
|
||||
|
||||
xor eax,eax
|
||||
cmp ebx,0x756e6547
|
||||
setne al
|
||||
mov r9d,eax
|
||||
cmp edx,0x49656e69
|
||||
setne al
|
||||
or r9d,eax
|
||||
cmp ecx,0x6c65746e
|
||||
setne al
|
||||
or r9d,eax
|
||||
jz NEAR $L$intel
|
||||
|
||||
cmp ebx,0x68747541
|
||||
setne al
|
||||
mov r10d,eax
|
||||
cmp edx,0x69746E65
|
||||
setne al
|
||||
or r10d,eax
|
||||
cmp ecx,0x444D4163
|
||||
setne al
|
||||
or r10d,eax
|
||||
jnz NEAR $L$intel
|
||||
|
||||
|
||||
mov eax,0x80000000
|
||||
cpuid
|
||||
cmp eax,0x80000001
|
||||
jb NEAR $L$intel
|
||||
mov r10d,eax
|
||||
mov eax,0x80000001
|
||||
cpuid
|
||||
or r9d,ecx
|
||||
and r9d,0x00000801
|
||||
|
||||
cmp r10d,0x80000008
|
||||
jb NEAR $L$intel
|
||||
|
||||
mov eax,0x80000008
|
||||
cpuid
|
||||
movzx r10,cl
|
||||
inc r10
|
||||
|
||||
mov eax,1
|
||||
cpuid
|
||||
bt edx,28
|
||||
jnc NEAR $L$generic
|
||||
shr ebx,16
|
||||
cmp bl,r10b
|
||||
ja NEAR $L$generic
|
||||
and edx,0xefffffff
|
||||
jmp NEAR $L$generic
|
||||
|
||||
$L$intel:
|
||||
cmp r11d,4
|
||||
mov r10d,-1
|
||||
jb NEAR $L$nocacheinfo
|
||||
|
||||
mov eax,4
|
||||
mov ecx,0
|
||||
cpuid
|
||||
mov r10d,eax
|
||||
shr r10d,14
|
||||
and r10d,0xfff
|
||||
|
||||
$L$nocacheinfo:
|
||||
mov eax,1
|
||||
cpuid
|
||||
movd xmm0,eax
|
||||
and edx,0xbfefffff
|
||||
cmp r9d,0
|
||||
jne NEAR $L$notintel
|
||||
or edx,0x40000000
|
||||
and ah,15
|
||||
cmp ah,15
|
||||
jne NEAR $L$notP4
|
||||
or edx,0x00100000
|
||||
$L$notP4:
|
||||
cmp ah,6
|
||||
jne NEAR $L$notintel
|
||||
and eax,0x0fff0ff0
|
||||
cmp eax,0x00050670
|
||||
je NEAR $L$knights
|
||||
cmp eax,0x00080650
|
||||
jne NEAR $L$notintel
|
||||
$L$knights:
|
||||
and ecx,0xfbffffff
|
||||
|
||||
$L$notintel:
|
||||
bt edx,28
|
||||
jnc NEAR $L$generic
|
||||
and edx,0xefffffff
|
||||
cmp r10d,0
|
||||
je NEAR $L$generic
|
||||
|
||||
or edx,0x10000000
|
||||
shr ebx,16
|
||||
cmp bl,1
|
||||
ja NEAR $L$generic
|
||||
and edx,0xefffffff
|
||||
$L$generic:
|
||||
and r9d,0x00000800
|
||||
and ecx,0xfffff7ff
|
||||
or r9d,ecx
|
||||
|
||||
mov r10d,edx
|
||||
|
||||
cmp r11d,7
|
||||
jb NEAR $L$no_extended_info
|
||||
mov eax,7
|
||||
xor ecx,ecx
|
||||
cpuid
|
||||
bt r9d,26
|
||||
jc NEAR $L$notknights
|
||||
and ebx,0xfff7ffff
|
||||
$L$notknights:
|
||||
movd eax,xmm0
|
||||
and eax,0x0fff0ff0
|
||||
cmp eax,0x00050650
|
||||
jne NEAR $L$notskylakex
|
||||
and ebx,0xfffeffff
|
||||
|
||||
$L$notskylakex:
|
||||
mov DWORD[8+rdi],ebx
|
||||
mov DWORD[12+rdi],ecx
|
||||
$L$no_extended_info:
|
||||
|
||||
bt r9d,27
|
||||
jnc NEAR $L$clear_avx
|
||||
xor ecx,ecx
|
||||
DB 0x0f,0x01,0xd0
|
||||
and eax,0xe6
|
||||
cmp eax,0xe6
|
||||
je NEAR $L$done
|
||||
and DWORD[8+rdi],0x3fdeffff
|
||||
|
||||
|
||||
|
||||
|
||||
and eax,6
|
||||
cmp eax,6
|
||||
je NEAR $L$done
|
||||
$L$clear_avx:
|
||||
mov eax,0xefffe7ff
|
||||
and r9d,eax
|
||||
mov eax,0x3fdeffdf
|
||||
and DWORD[8+rdi],eax
|
||||
$L$done:
|
||||
shl r9,32
|
||||
mov eax,r10d
|
||||
mov rbx,r8
|
||||
|
||||
or rax,r9
|
||||
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
||||
mov rsi,QWORD[16+rsp]
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
$L$SEH_end_OPENSSL_ia32_cpuid:
|
||||
|
||||
global OPENSSL_cleanse
|
||||
|
||||
ALIGN 16
|
||||
OPENSSL_cleanse:
|
||||
|
||||
xor rax,rax
|
||||
cmp rdx,15
|
||||
jae NEAR $L$ot
|
||||
cmp rdx,0
|
||||
je NEAR $L$ret
|
||||
$L$ittle:
|
||||
mov BYTE[rcx],al
|
||||
sub rdx,1
|
||||
lea rcx,[1+rcx]
|
||||
jnz NEAR $L$ittle
|
||||
$L$ret:
|
||||
DB 0F3h,0C3h ;repret
|
||||
ALIGN 16
|
||||
$L$ot:
|
||||
test rcx,7
|
||||
jz NEAR $L$aligned
|
||||
mov BYTE[rcx],al
|
||||
lea rdx,[((-1))+rdx]
|
||||
lea rcx,[1+rcx]
|
||||
jmp NEAR $L$ot
|
||||
$L$aligned:
|
||||
mov QWORD[rcx],rax
|
||||
lea rdx,[((-8))+rdx]
|
||||
test rdx,-8
|
||||
lea rcx,[8+rcx]
|
||||
jnz NEAR $L$aligned
|
||||
cmp rdx,0
|
||||
jne NEAR $L$ittle
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
|
||||
global CRYPTO_memcmp
|
||||
|
||||
ALIGN 16
|
||||
CRYPTO_memcmp:
|
||||
|
||||
xor rax,rax
|
||||
xor r10,r10
|
||||
cmp r8,0
|
||||
je NEAR $L$no_data
|
||||
cmp r8,16
|
||||
jne NEAR $L$oop_cmp
|
||||
mov r10,QWORD[rcx]
|
||||
mov r11,QWORD[8+rcx]
|
||||
mov r8,1
|
||||
xor r10,QWORD[rdx]
|
||||
xor r11,QWORD[8+rdx]
|
||||
or r10,r11
|
||||
cmovnz rax,r8
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
ALIGN 16
|
||||
$L$oop_cmp:
|
||||
mov r10b,BYTE[rcx]
|
||||
lea rcx,[1+rcx]
|
||||
xor r10b,BYTE[rdx]
|
||||
lea rdx,[1+rdx]
|
||||
or al,r10b
|
||||
dec r8
|
||||
jnz NEAR $L$oop_cmp
|
||||
neg rax
|
||||
shr rax,63
|
||||
$L$no_data:
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
global OPENSSL_wipe_cpu
|
||||
|
||||
ALIGN 16
|
||||
OPENSSL_wipe_cpu:
|
||||
pxor xmm0,xmm0
|
||||
pxor xmm1,xmm1
|
||||
pxor xmm2,xmm2
|
||||
pxor xmm3,xmm3
|
||||
pxor xmm4,xmm4
|
||||
pxor xmm5,xmm5
|
||||
xor rcx,rcx
|
||||
xor rdx,rdx
|
||||
xor r8,r8
|
||||
xor r9,r9
|
||||
xor r10,r10
|
||||
xor r11,r11
|
||||
lea rax,[8+rsp]
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
global OPENSSL_instrument_bus
|
||||
|
||||
ALIGN 16
|
||||
OPENSSL_instrument_bus:
|
||||
|
||||
mov r10,rcx
|
||||
mov rcx,rdx
|
||||
mov r11,rdx
|
||||
|
||||
rdtsc
|
||||
mov r8d,eax
|
||||
mov r9d,0
|
||||
clflush [r10]
|
||||
DB 0xf0
|
||||
add DWORD[r10],r9d
|
||||
jmp NEAR $L$oop
|
||||
ALIGN 16
|
||||
$L$oop: rdtsc
|
||||
mov edx,eax
|
||||
sub eax,r8d
|
||||
mov r8d,edx
|
||||
mov r9d,eax
|
||||
clflush [r10]
|
||||
DB 0xf0
|
||||
add DWORD[r10],eax
|
||||
lea r10,[4+r10]
|
||||
sub rcx,1
|
||||
jnz NEAR $L$oop
|
||||
|
||||
mov rax,r11
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
|
||||
global OPENSSL_instrument_bus2
|
||||
|
||||
ALIGN 16
|
||||
OPENSSL_instrument_bus2:
|
||||
|
||||
mov r10,rcx
|
||||
mov rcx,rdx
|
||||
mov r11,r8
|
||||
mov QWORD[8+rsp],rcx
|
||||
|
||||
rdtsc
|
||||
mov r8d,eax
|
||||
mov r9d,0
|
||||
|
||||
clflush [r10]
|
||||
DB 0xf0
|
||||
add DWORD[r10],r9d
|
||||
|
||||
rdtsc
|
||||
mov edx,eax
|
||||
sub eax,r8d
|
||||
mov r8d,edx
|
||||
mov r9d,eax
|
||||
$L$oop2:
|
||||
clflush [r10]
|
||||
DB 0xf0
|
||||
add DWORD[r10],eax
|
||||
|
||||
sub r11,1
|
||||
jz NEAR $L$done2
|
||||
|
||||
rdtsc
|
||||
mov edx,eax
|
||||
sub eax,r8d
|
||||
mov r8d,edx
|
||||
cmp eax,r9d
|
||||
mov r9d,eax
|
||||
mov edx,0
|
||||
setne dl
|
||||
sub rcx,rdx
|
||||
lea r10,[rdx*4+r10]
|
||||
jnz NEAR $L$oop2
|
||||
|
||||
$L$done2:
|
||||
mov rax,QWORD[8+rsp]
|
||||
sub rax,rcx
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
global OPENSSL_ia32_rdrand_bytes
|
||||
|
||||
ALIGN 16
|
||||
OPENSSL_ia32_rdrand_bytes:
|
||||
|
||||
xor rax,rax
|
||||
cmp rdx,0
|
||||
je NEAR $L$done_rdrand_bytes
|
||||
|
||||
mov r11,8
|
||||
$L$oop_rdrand_bytes:
|
||||
DB 73,15,199,242
|
||||
jc NEAR $L$break_rdrand_bytes
|
||||
dec r11
|
||||
jnz NEAR $L$oop_rdrand_bytes
|
||||
jmp NEAR $L$done_rdrand_bytes
|
||||
|
||||
ALIGN 16
|
||||
$L$break_rdrand_bytes:
|
||||
cmp rdx,8
|
||||
jb NEAR $L$tail_rdrand_bytes
|
||||
mov QWORD[rcx],r10
|
||||
lea rcx,[8+rcx]
|
||||
add rax,8
|
||||
sub rdx,8
|
||||
jz NEAR $L$done_rdrand_bytes
|
||||
mov r11,8
|
||||
jmp NEAR $L$oop_rdrand_bytes
|
||||
|
||||
ALIGN 16
|
||||
$L$tail_rdrand_bytes:
|
||||
mov BYTE[rcx],r10b
|
||||
lea rcx,[1+rcx]
|
||||
inc rax
|
||||
shr r10,8
|
||||
dec rdx
|
||||
jnz NEAR $L$tail_rdrand_bytes
|
||||
|
||||
$L$done_rdrand_bytes:
|
||||
xor r10,r10
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
||||
global OPENSSL_ia32_rdseed_bytes
|
||||
|
||||
ALIGN 16
|
||||
OPENSSL_ia32_rdseed_bytes:
|
||||
|
||||
xor rax,rax
|
||||
cmp rdx,0
|
||||
je NEAR $L$done_rdseed_bytes
|
||||
|
||||
mov r11,8
|
||||
$L$oop_rdseed_bytes:
|
||||
DB 73,15,199,250
|
||||
jc NEAR $L$break_rdseed_bytes
|
||||
dec r11
|
||||
jnz NEAR $L$oop_rdseed_bytes
|
||||
jmp NEAR $L$done_rdseed_bytes
|
||||
|
||||
ALIGN 16
|
||||
$L$break_rdseed_bytes:
|
||||
cmp rdx,8
|
||||
jb NEAR $L$tail_rdseed_bytes
|
||||
mov QWORD[rcx],r10
|
||||
lea rcx,[8+rcx]
|
||||
add rax,8
|
||||
sub rdx,8
|
||||
jz NEAR $L$done_rdseed_bytes
|
||||
mov r11,8
|
||||
jmp NEAR $L$oop_rdseed_bytes
|
||||
|
||||
ALIGN 16
|
||||
$L$tail_rdseed_bytes:
|
||||
mov BYTE[rcx],r10b
|
||||
lea rcx,[1+rcx]
|
||||
inc rax
|
||||
shr r10,8
|
||||
dec rdx
|
||||
jnz NEAR $L$tail_rdseed_bytes
|
||||
|
||||
$L$done_rdseed_bytes:
|
||||
xor r10,r10
|
||||
DB 0F3h,0C3h ;repret
|
||||
|
||||
|
Reference in New Issue
Block a user