mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-07 19:45:07 +02:00
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:
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
|
||||
|
||||
|
552
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/aes/aesni-mb-x86_64.S
Normal file
552
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/aes/aesni-mb-x86_64.S
Normal file
@ -0,0 +1,552 @@
|
||||
# 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
|
||||
|
||||
.text
|
||||
|
||||
|
||||
|
||||
.globl aesni_multi_cbc_encrypt
|
||||
.type aesni_multi_cbc_encrypt,@function
|
||||
.align 32
|
||||
aesni_multi_cbc_encrypt:
|
||||
.cfi_startproc
|
||||
movq %rsp,%rax
|
||||
.cfi_def_cfa_register %rax
|
||||
pushq %rbx
|
||||
.cfi_offset %rbx,-16
|
||||
pushq %rbp
|
||||
.cfi_offset %rbp,-24
|
||||
pushq %r12
|
||||
.cfi_offset %r12,-32
|
||||
pushq %r13
|
||||
.cfi_offset %r13,-40
|
||||
pushq %r14
|
||||
.cfi_offset %r14,-48
|
||||
pushq %r15
|
||||
.cfi_offset %r15,-56
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
subq $48,%rsp
|
||||
andq $-64,%rsp
|
||||
movq %rax,16(%rsp)
|
||||
.cfi_escape 0x0f,0x05,0x77,0x10,0x06,0x23,0x08
|
||||
|
||||
.Lenc4x_body:
|
||||
movdqu (%rsi),%xmm12
|
||||
leaq 120(%rsi),%rsi
|
||||
leaq 80(%rdi),%rdi
|
||||
|
||||
.Lenc4x_loop_grande:
|
||||
movl %edx,24(%rsp)
|
||||
xorl %edx,%edx
|
||||
movl -64(%rdi),%ecx
|
||||
movq -80(%rdi),%r8
|
||||
cmpl %edx,%ecx
|
||||
movq -72(%rdi),%r12
|
||||
cmovgl %ecx,%edx
|
||||
testl %ecx,%ecx
|
||||
movdqu -56(%rdi),%xmm2
|
||||
movl %ecx,32(%rsp)
|
||||
cmovleq %rsp,%r8
|
||||
movl -24(%rdi),%ecx
|
||||
movq -40(%rdi),%r9
|
||||
cmpl %edx,%ecx
|
||||
movq -32(%rdi),%r13
|
||||
cmovgl %ecx,%edx
|
||||
testl %ecx,%ecx
|
||||
movdqu -16(%rdi),%xmm3
|
||||
movl %ecx,36(%rsp)
|
||||
cmovleq %rsp,%r9
|
||||
movl 16(%rdi),%ecx
|
||||
movq 0(%rdi),%r10
|
||||
cmpl %edx,%ecx
|
||||
movq 8(%rdi),%r14
|
||||
cmovgl %ecx,%edx
|
||||
testl %ecx,%ecx
|
||||
movdqu 24(%rdi),%xmm4
|
||||
movl %ecx,40(%rsp)
|
||||
cmovleq %rsp,%r10
|
||||
movl 56(%rdi),%ecx
|
||||
movq 40(%rdi),%r11
|
||||
cmpl %edx,%ecx
|
||||
movq 48(%rdi),%r15
|
||||
cmovgl %ecx,%edx
|
||||
testl %ecx,%ecx
|
||||
movdqu 64(%rdi),%xmm5
|
||||
movl %ecx,44(%rsp)
|
||||
cmovleq %rsp,%r11
|
||||
testl %edx,%edx
|
||||
jz .Lenc4x_done
|
||||
|
||||
movups 16-120(%rsi),%xmm1
|
||||
pxor %xmm12,%xmm2
|
||||
movups 32-120(%rsi),%xmm0
|
||||
pxor %xmm12,%xmm3
|
||||
movl 240-120(%rsi),%eax
|
||||
pxor %xmm12,%xmm4
|
||||
movdqu (%r8),%xmm6
|
||||
pxor %xmm12,%xmm5
|
||||
movdqu (%r9),%xmm7
|
||||
pxor %xmm6,%xmm2
|
||||
movdqu (%r10),%xmm8
|
||||
pxor %xmm7,%xmm3
|
||||
movdqu (%r11),%xmm9
|
||||
pxor %xmm8,%xmm4
|
||||
pxor %xmm9,%xmm5
|
||||
movdqa 32(%rsp),%xmm10
|
||||
xorq %rbx,%rbx
|
||||
jmp .Loop_enc4x
|
||||
|
||||
.align 32
|
||||
.Loop_enc4x:
|
||||
addq $16,%rbx
|
||||
leaq 16(%rsp),%rbp
|
||||
movl $1,%ecx
|
||||
subq %rbx,%rbp
|
||||
|
||||
.byte 102,15,56,220,209
|
||||
prefetcht0 31(%r8,%rbx,1)
|
||||
prefetcht0 31(%r9,%rbx,1)
|
||||
.byte 102,15,56,220,217
|
||||
prefetcht0 31(%r10,%rbx,1)
|
||||
prefetcht0 31(%r10,%rbx,1)
|
||||
.byte 102,15,56,220,225
|
||||
.byte 102,15,56,220,233
|
||||
movups 48-120(%rsi),%xmm1
|
||||
cmpl 32(%rsp),%ecx
|
||||
.byte 102,15,56,220,208
|
||||
.byte 102,15,56,220,216
|
||||
.byte 102,15,56,220,224
|
||||
cmovgeq %rbp,%r8
|
||||
cmovgq %rbp,%r12
|
||||
.byte 102,15,56,220,232
|
||||
movups -56(%rsi),%xmm0
|
||||
cmpl 36(%rsp),%ecx
|
||||
.byte 102,15,56,220,209
|
||||
.byte 102,15,56,220,217
|
||||
.byte 102,15,56,220,225
|
||||
cmovgeq %rbp,%r9
|
||||
cmovgq %rbp,%r13
|
||||
.byte 102,15,56,220,233
|
||||
movups -40(%rsi),%xmm1
|
||||
cmpl 40(%rsp),%ecx
|
||||
.byte 102,15,56,220,208
|
||||
.byte 102,15,56,220,216
|
||||
.byte 102,15,56,220,224
|
||||
cmovgeq %rbp,%r10
|
||||
cmovgq %rbp,%r14
|
||||
.byte 102,15,56,220,232
|
||||
movups -24(%rsi),%xmm0
|
||||
cmpl 44(%rsp),%ecx
|
||||
.byte 102,15,56,220,209
|
||||
.byte 102,15,56,220,217
|
||||
.byte 102,15,56,220,225
|
||||
cmovgeq %rbp,%r11
|
||||
cmovgq %rbp,%r15
|
||||
.byte 102,15,56,220,233
|
||||
movups -8(%rsi),%xmm1
|
||||
movdqa %xmm10,%xmm11
|
||||
.byte 102,15,56,220,208
|
||||
prefetcht0 15(%r12,%rbx,1)
|
||||
prefetcht0 15(%r13,%rbx,1)
|
||||
.byte 102,15,56,220,216
|
||||
prefetcht0 15(%r14,%rbx,1)
|
||||
prefetcht0 15(%r15,%rbx,1)
|
||||
.byte 102,15,56,220,224
|
||||
.byte 102,15,56,220,232
|
||||
movups 128-120(%rsi),%xmm0
|
||||
pxor %xmm12,%xmm12
|
||||
|
||||
.byte 102,15,56,220,209
|
||||
pcmpgtd %xmm12,%xmm11
|
||||
movdqu -120(%rsi),%xmm12
|
||||
.byte 102,15,56,220,217
|
||||
paddd %xmm11,%xmm10
|
||||
movdqa %xmm10,32(%rsp)
|
||||
.byte 102,15,56,220,225
|
||||
.byte 102,15,56,220,233
|
||||
movups 144-120(%rsi),%xmm1
|
||||
|
||||
cmpl $11,%eax
|
||||
|
||||
.byte 102,15,56,220,208
|
||||
.byte 102,15,56,220,216
|
||||
.byte 102,15,56,220,224
|
||||
.byte 102,15,56,220,232
|
||||
movups 160-120(%rsi),%xmm0
|
||||
|
||||
jb .Lenc4x_tail
|
||||
|
||||
.byte 102,15,56,220,209
|
||||
.byte 102,15,56,220,217
|
||||
.byte 102,15,56,220,225
|
||||
.byte 102,15,56,220,233
|
||||
movups 176-120(%rsi),%xmm1
|
||||
|
||||
.byte 102,15,56,220,208
|
||||
.byte 102,15,56,220,216
|
||||
.byte 102,15,56,220,224
|
||||
.byte 102,15,56,220,232
|
||||
movups 192-120(%rsi),%xmm0
|
||||
|
||||
je .Lenc4x_tail
|
||||
|
||||
.byte 102,15,56,220,209
|
||||
.byte 102,15,56,220,217
|
||||
.byte 102,15,56,220,225
|
||||
.byte 102,15,56,220,233
|
||||
movups 208-120(%rsi),%xmm1
|
||||
|
||||
.byte 102,15,56,220,208
|
||||
.byte 102,15,56,220,216
|
||||
.byte 102,15,56,220,224
|
||||
.byte 102,15,56,220,232
|
||||
movups 224-120(%rsi),%xmm0
|
||||
jmp .Lenc4x_tail
|
||||
|
||||
.align 32
|
||||
.Lenc4x_tail:
|
||||
.byte 102,15,56,220,209
|
||||
.byte 102,15,56,220,217
|
||||
.byte 102,15,56,220,225
|
||||
.byte 102,15,56,220,233
|
||||
movdqu (%r8,%rbx,1),%xmm6
|
||||
movdqu 16-120(%rsi),%xmm1
|
||||
|
||||
.byte 102,15,56,221,208
|
||||
movdqu (%r9,%rbx,1),%xmm7
|
||||
pxor %xmm12,%xmm6
|
||||
.byte 102,15,56,221,216
|
||||
movdqu (%r10,%rbx,1),%xmm8
|
||||
pxor %xmm12,%xmm7
|
||||
.byte 102,15,56,221,224
|
||||
movdqu (%r11,%rbx,1),%xmm9
|
||||
pxor %xmm12,%xmm8
|
||||
.byte 102,15,56,221,232
|
||||
movdqu 32-120(%rsi),%xmm0
|
||||
pxor %xmm12,%xmm9
|
||||
|
||||
movups %xmm2,-16(%r12,%rbx,1)
|
||||
pxor %xmm6,%xmm2
|
||||
movups %xmm3,-16(%r13,%rbx,1)
|
||||
pxor %xmm7,%xmm3
|
||||
movups %xmm4,-16(%r14,%rbx,1)
|
||||
pxor %xmm8,%xmm4
|
||||
movups %xmm5,-16(%r15,%rbx,1)
|
||||
pxor %xmm9,%xmm5
|
||||
|
||||
decl %edx
|
||||
jnz .Loop_enc4x
|
||||
|
||||
movq 16(%rsp),%rax
|
||||
.cfi_def_cfa %rax,8
|
||||
movl 24(%rsp),%edx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
leaq 160(%rdi),%rdi
|
||||
decl %edx
|
||||
jnz .Lenc4x_loop_grande
|
||||
|
||||
.Lenc4x_done:
|
||||
movq -48(%rax),%r15
|
||||
.cfi_restore %r15
|
||||
movq -40(%rax),%r14
|
||||
.cfi_restore %r14
|
||||
movq -32(%rax),%r13
|
||||
.cfi_restore %r13
|
||||
movq -24(%rax),%r12
|
||||
.cfi_restore %r12
|
||||
movq -16(%rax),%rbp
|
||||
.cfi_restore %rbp
|
||||
movq -8(%rax),%rbx
|
||||
.cfi_restore %rbx
|
||||
leaq (%rax),%rsp
|
||||
.cfi_def_cfa_register %rsp
|
||||
.Lenc4x_epilogue:
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size aesni_multi_cbc_encrypt,.-aesni_multi_cbc_encrypt
|
||||
|
||||
.globl aesni_multi_cbc_decrypt
|
||||
.type aesni_multi_cbc_decrypt,@function
|
||||
.align 32
|
||||
aesni_multi_cbc_decrypt:
|
||||
.cfi_startproc
|
||||
movq %rsp,%rax
|
||||
.cfi_def_cfa_register %rax
|
||||
pushq %rbx
|
||||
.cfi_offset %rbx,-16
|
||||
pushq %rbp
|
||||
.cfi_offset %rbp,-24
|
||||
pushq %r12
|
||||
.cfi_offset %r12,-32
|
||||
pushq %r13
|
||||
.cfi_offset %r13,-40
|
||||
pushq %r14
|
||||
.cfi_offset %r14,-48
|
||||
pushq %r15
|
||||
.cfi_offset %r15,-56
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
subq $48,%rsp
|
||||
andq $-64,%rsp
|
||||
movq %rax,16(%rsp)
|
||||
.cfi_escape 0x0f,0x05,0x77,0x10,0x06,0x23,0x08
|
||||
|
||||
.Ldec4x_body:
|
||||
movdqu (%rsi),%xmm12
|
||||
leaq 120(%rsi),%rsi
|
||||
leaq 80(%rdi),%rdi
|
||||
|
||||
.Ldec4x_loop_grande:
|
||||
movl %edx,24(%rsp)
|
||||
xorl %edx,%edx
|
||||
movl -64(%rdi),%ecx
|
||||
movq -80(%rdi),%r8
|
||||
cmpl %edx,%ecx
|
||||
movq -72(%rdi),%r12
|
||||
cmovgl %ecx,%edx
|
||||
testl %ecx,%ecx
|
||||
movdqu -56(%rdi),%xmm6
|
||||
movl %ecx,32(%rsp)
|
||||
cmovleq %rsp,%r8
|
||||
movl -24(%rdi),%ecx
|
||||
movq -40(%rdi),%r9
|
||||
cmpl %edx,%ecx
|
||||
movq -32(%rdi),%r13
|
||||
cmovgl %ecx,%edx
|
||||
testl %ecx,%ecx
|
||||
movdqu -16(%rdi),%xmm7
|
||||
movl %ecx,36(%rsp)
|
||||
cmovleq %rsp,%r9
|
||||
movl 16(%rdi),%ecx
|
||||
movq 0(%rdi),%r10
|
||||
cmpl %edx,%ecx
|
||||
movq 8(%rdi),%r14
|
||||
cmovgl %ecx,%edx
|
||||
testl %ecx,%ecx
|
||||
movdqu 24(%rdi),%xmm8
|
||||
movl %ecx,40(%rsp)
|
||||
cmovleq %rsp,%r10
|
||||
movl 56(%rdi),%ecx
|
||||
movq 40(%rdi),%r11
|
||||
cmpl %edx,%ecx
|
||||
movq 48(%rdi),%r15
|
||||
cmovgl %ecx,%edx
|
||||
testl %ecx,%ecx
|
||||
movdqu 64(%rdi),%xmm9
|
||||
movl %ecx,44(%rsp)
|
||||
cmovleq %rsp,%r11
|
||||
testl %edx,%edx
|
||||
jz .Ldec4x_done
|
||||
|
||||
movups 16-120(%rsi),%xmm1
|
||||
movups 32-120(%rsi),%xmm0
|
||||
movl 240-120(%rsi),%eax
|
||||
movdqu (%r8),%xmm2
|
||||
movdqu (%r9),%xmm3
|
||||
pxor %xmm12,%xmm2
|
||||
movdqu (%r10),%xmm4
|
||||
pxor %xmm12,%xmm3
|
||||
movdqu (%r11),%xmm5
|
||||
pxor %xmm12,%xmm4
|
||||
pxor %xmm12,%xmm5
|
||||
movdqa 32(%rsp),%xmm10
|
||||
xorq %rbx,%rbx
|
||||
jmp .Loop_dec4x
|
||||
|
||||
.align 32
|
||||
.Loop_dec4x:
|
||||
addq $16,%rbx
|
||||
leaq 16(%rsp),%rbp
|
||||
movl $1,%ecx
|
||||
subq %rbx,%rbp
|
||||
|
||||
.byte 102,15,56,222,209
|
||||
prefetcht0 31(%r8,%rbx,1)
|
||||
prefetcht0 31(%r9,%rbx,1)
|
||||
.byte 102,15,56,222,217
|
||||
prefetcht0 31(%r10,%rbx,1)
|
||||
prefetcht0 31(%r11,%rbx,1)
|
||||
.byte 102,15,56,222,225
|
||||
.byte 102,15,56,222,233
|
||||
movups 48-120(%rsi),%xmm1
|
||||
cmpl 32(%rsp),%ecx
|
||||
.byte 102,15,56,222,208
|
||||
.byte 102,15,56,222,216
|
||||
.byte 102,15,56,222,224
|
||||
cmovgeq %rbp,%r8
|
||||
cmovgq %rbp,%r12
|
||||
.byte 102,15,56,222,232
|
||||
movups -56(%rsi),%xmm0
|
||||
cmpl 36(%rsp),%ecx
|
||||
.byte 102,15,56,222,209
|
||||
.byte 102,15,56,222,217
|
||||
.byte 102,15,56,222,225
|
||||
cmovgeq %rbp,%r9
|
||||
cmovgq %rbp,%r13
|
||||
.byte 102,15,56,222,233
|
||||
movups -40(%rsi),%xmm1
|
||||
cmpl 40(%rsp),%ecx
|
||||
.byte 102,15,56,222,208
|
||||
.byte 102,15,56,222,216
|
||||
.byte 102,15,56,222,224
|
||||
cmovgeq %rbp,%r10
|
||||
cmovgq %rbp,%r14
|
||||
.byte 102,15,56,222,232
|
||||
movups -24(%rsi),%xmm0
|
||||
cmpl 44(%rsp),%ecx
|
||||
.byte 102,15,56,222,209
|
||||
.byte 102,15,56,222,217
|
||||
.byte 102,15,56,222,225
|
||||
cmovgeq %rbp,%r11
|
||||
cmovgq %rbp,%r15
|
||||
.byte 102,15,56,222,233
|
||||
movups -8(%rsi),%xmm1
|
||||
movdqa %xmm10,%xmm11
|
||||
.byte 102,15,56,222,208
|
||||
prefetcht0 15(%r12,%rbx,1)
|
||||
prefetcht0 15(%r13,%rbx,1)
|
||||
.byte 102,15,56,222,216
|
||||
prefetcht0 15(%r14,%rbx,1)
|
||||
prefetcht0 15(%r15,%rbx,1)
|
||||
.byte 102,15,56,222,224
|
||||
.byte 102,15,56,222,232
|
||||
movups 128-120(%rsi),%xmm0
|
||||
pxor %xmm12,%xmm12
|
||||
|
||||
.byte 102,15,56,222,209
|
||||
pcmpgtd %xmm12,%xmm11
|
||||
movdqu -120(%rsi),%xmm12
|
||||
.byte 102,15,56,222,217
|
||||
paddd %xmm11,%xmm10
|
||||
movdqa %xmm10,32(%rsp)
|
||||
.byte 102,15,56,222,225
|
||||
.byte 102,15,56,222,233
|
||||
movups 144-120(%rsi),%xmm1
|
||||
|
||||
cmpl $11,%eax
|
||||
|
||||
.byte 102,15,56,222,208
|
||||
.byte 102,15,56,222,216
|
||||
.byte 102,15,56,222,224
|
||||
.byte 102,15,56,222,232
|
||||
movups 160-120(%rsi),%xmm0
|
||||
|
||||
jb .Ldec4x_tail
|
||||
|
||||
.byte 102,15,56,222,209
|
||||
.byte 102,15,56,222,217
|
||||
.byte 102,15,56,222,225
|
||||
.byte 102,15,56,222,233
|
||||
movups 176-120(%rsi),%xmm1
|
||||
|
||||
.byte 102,15,56,222,208
|
||||
.byte 102,15,56,222,216
|
||||
.byte 102,15,56,222,224
|
||||
.byte 102,15,56,222,232
|
||||
movups 192-120(%rsi),%xmm0
|
||||
|
||||
je .Ldec4x_tail
|
||||
|
||||
.byte 102,15,56,222,209
|
||||
.byte 102,15,56,222,217
|
||||
.byte 102,15,56,222,225
|
||||
.byte 102,15,56,222,233
|
||||
movups 208-120(%rsi),%xmm1
|
||||
|
||||
.byte 102,15,56,222,208
|
||||
.byte 102,15,56,222,216
|
||||
.byte 102,15,56,222,224
|
||||
.byte 102,15,56,222,232
|
||||
movups 224-120(%rsi),%xmm0
|
||||
jmp .Ldec4x_tail
|
||||
|
||||
.align 32
|
||||
.Ldec4x_tail:
|
||||
.byte 102,15,56,222,209
|
||||
.byte 102,15,56,222,217
|
||||
.byte 102,15,56,222,225
|
||||
pxor %xmm0,%xmm6
|
||||
pxor %xmm0,%xmm7
|
||||
.byte 102,15,56,222,233
|
||||
movdqu 16-120(%rsi),%xmm1
|
||||
pxor %xmm0,%xmm8
|
||||
pxor %xmm0,%xmm9
|
||||
movdqu 32-120(%rsi),%xmm0
|
||||
|
||||
.byte 102,15,56,223,214
|
||||
.byte 102,15,56,223,223
|
||||
movdqu -16(%r8,%rbx,1),%xmm6
|
||||
movdqu -16(%r9,%rbx,1),%xmm7
|
||||
.byte 102,65,15,56,223,224
|
||||
.byte 102,65,15,56,223,233
|
||||
movdqu -16(%r10,%rbx,1),%xmm8
|
||||
movdqu -16(%r11,%rbx,1),%xmm9
|
||||
|
||||
movups %xmm2,-16(%r12,%rbx,1)
|
||||
movdqu (%r8,%rbx,1),%xmm2
|
||||
movups %xmm3,-16(%r13,%rbx,1)
|
||||
movdqu (%r9,%rbx,1),%xmm3
|
||||
pxor %xmm12,%xmm2
|
||||
movups %xmm4,-16(%r14,%rbx,1)
|
||||
movdqu (%r10,%rbx,1),%xmm4
|
||||
pxor %xmm12,%xmm3
|
||||
movups %xmm5,-16(%r15,%rbx,1)
|
||||
movdqu (%r11,%rbx,1),%xmm5
|
||||
pxor %xmm12,%xmm4
|
||||
pxor %xmm12,%xmm5
|
||||
|
||||
decl %edx
|
||||
jnz .Loop_dec4x
|
||||
|
||||
movq 16(%rsp),%rax
|
||||
.cfi_def_cfa %rax,8
|
||||
movl 24(%rsp),%edx
|
||||
|
||||
leaq 160(%rdi),%rdi
|
||||
decl %edx
|
||||
jnz .Ldec4x_loop_grande
|
||||
|
||||
.Ldec4x_done:
|
||||
movq -48(%rax),%r15
|
||||
.cfi_restore %r15
|
||||
movq -40(%rax),%r14
|
||||
.cfi_restore %r14
|
||||
movq -32(%rax),%r13
|
||||
.cfi_restore %r13
|
||||
movq -24(%rax),%r12
|
||||
.cfi_restore %r12
|
||||
movq -16(%rax),%rbp
|
||||
.cfi_restore %rbp
|
||||
movq -8(%rax),%rbx
|
||||
.cfi_restore %rbx
|
||||
leaq (%rax),%rsp
|
||||
.cfi_def_cfa_register %rsp
|
||||
.Ldec4x_epilogue:
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size aesni_multi_cbc_decrypt,.-aesni_multi_cbc_decrypt
|
1719
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/aes/aesni-sha1-x86_64.S
Normal file
1719
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/aes/aesni-sha1-x86_64.S
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,69 @@
|
||||
# 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
|
||||
|
||||
.text
|
||||
|
||||
|
||||
.globl aesni_cbc_sha256_enc
|
||||
.type aesni_cbc_sha256_enc,@function
|
||||
.align 16
|
||||
aesni_cbc_sha256_enc:
|
||||
.cfi_startproc
|
||||
xorl %eax,%eax
|
||||
cmpq $0,%rdi
|
||||
je .Lprobe
|
||||
ud2
|
||||
.Lprobe:
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size aesni_cbc_sha256_enc,.-aesni_cbc_sha256_enc
|
||||
|
||||
.align 64
|
||||
.type K256,@object
|
||||
K256:
|
||||
.long 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
|
||||
.long 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
|
||||
.long 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
|
||||
.long 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
|
||||
.long 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
|
||||
.long 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
|
||||
.long 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
|
||||
.long 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
|
||||
.long 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
|
||||
.long 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
|
||||
.long 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
|
||||
.long 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
|
||||
.long 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
|
||||
.long 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
|
||||
.long 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
|
||||
.long 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
|
||||
.long 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
|
||||
.long 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
|
||||
.long 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
|
||||
.long 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
|
||||
.long 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
|
||||
.long 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
|
||||
.long 0xd192e819,0xd6990624,0xf40e3585,0x106aa070
|
||||
.long 0xd192e819,0xd6990624,0xf40e3585,0x106aa070
|
||||
.long 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
|
||||
.long 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
|
||||
.long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
|
||||
.long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
|
||||
.long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
|
||||
.long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
|
||||
.long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
|
||||
.long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
|
||||
|
||||
.long 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
|
||||
.long 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
|
||||
.long 0,0,0,0, 0,0,0,0, -1,-1,-1,-1
|
||||
.long 0,0,0,0, 0,0,0,0
|
||||
.byte 65,69,83,78,73,45,67,66,67,43,83,72,65,50,53,54,32,115,116,105,116,99,104,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
|
||||
.align 64
|
4484
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/aes/aesni-x86_64.S
Normal file
4484
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/aes/aesni-x86_64.S
Normal file
File diff suppressed because it is too large
Load Diff
863
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/aes/vpaes-x86_64.S
Normal file
863
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/aes/vpaes-x86_64.S
Normal file
@ -0,0 +1,863 @@
|
||||
# WARNING: do not edit!
|
||||
# Generated from openssl/crypto/aes/asm/vpaes-x86_64.pl
|
||||
#
|
||||
# Copyright 2011-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
|
||||
|
||||
.text
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.type _vpaes_encrypt_core,@function
|
||||
.align 16
|
||||
_vpaes_encrypt_core:
|
||||
.cfi_startproc
|
||||
movq %rdx,%r9
|
||||
movq $16,%r11
|
||||
movl 240(%rdx),%eax
|
||||
movdqa %xmm9,%xmm1
|
||||
movdqa .Lk_ipt(%rip),%xmm2
|
||||
pandn %xmm0,%xmm1
|
||||
movdqu (%r9),%xmm5
|
||||
psrld $4,%xmm1
|
||||
pand %xmm9,%xmm0
|
||||
.byte 102,15,56,0,208
|
||||
movdqa .Lk_ipt+16(%rip),%xmm0
|
||||
.byte 102,15,56,0,193
|
||||
pxor %xmm5,%xmm2
|
||||
addq $16,%r9
|
||||
pxor %xmm2,%xmm0
|
||||
leaq .Lk_mc_backward(%rip),%r10
|
||||
jmp .Lenc_entry
|
||||
|
||||
.align 16
|
||||
.Lenc_loop:
|
||||
|
||||
movdqa %xmm13,%xmm4
|
||||
movdqa %xmm12,%xmm0
|
||||
.byte 102,15,56,0,226
|
||||
.byte 102,15,56,0,195
|
||||
pxor %xmm5,%xmm4
|
||||
movdqa %xmm15,%xmm5
|
||||
pxor %xmm4,%xmm0
|
||||
movdqa -64(%r11,%r10,1),%xmm1
|
||||
.byte 102,15,56,0,234
|
||||
movdqa (%r11,%r10,1),%xmm4
|
||||
movdqa %xmm14,%xmm2
|
||||
.byte 102,15,56,0,211
|
||||
movdqa %xmm0,%xmm3
|
||||
pxor %xmm5,%xmm2
|
||||
.byte 102,15,56,0,193
|
||||
addq $16,%r9
|
||||
pxor %xmm2,%xmm0
|
||||
.byte 102,15,56,0,220
|
||||
addq $16,%r11
|
||||
pxor %xmm0,%xmm3
|
||||
.byte 102,15,56,0,193
|
||||
andq $0x30,%r11
|
||||
subq $1,%rax
|
||||
pxor %xmm3,%xmm0
|
||||
|
||||
.Lenc_entry:
|
||||
|
||||
movdqa %xmm9,%xmm1
|
||||
movdqa %xmm11,%xmm5
|
||||
pandn %xmm0,%xmm1
|
||||
psrld $4,%xmm1
|
||||
pand %xmm9,%xmm0
|
||||
.byte 102,15,56,0,232
|
||||
movdqa %xmm10,%xmm3
|
||||
pxor %xmm1,%xmm0
|
||||
.byte 102,15,56,0,217
|
||||
movdqa %xmm10,%xmm4
|
||||
pxor %xmm5,%xmm3
|
||||
.byte 102,15,56,0,224
|
||||
movdqa %xmm10,%xmm2
|
||||
pxor %xmm5,%xmm4
|
||||
.byte 102,15,56,0,211
|
||||
movdqa %xmm10,%xmm3
|
||||
pxor %xmm0,%xmm2
|
||||
.byte 102,15,56,0,220
|
||||
movdqu (%r9),%xmm5
|
||||
pxor %xmm1,%xmm3
|
||||
jnz .Lenc_loop
|
||||
|
||||
|
||||
movdqa -96(%r10),%xmm4
|
||||
movdqa -80(%r10),%xmm0
|
||||
.byte 102,15,56,0,226
|
||||
pxor %xmm5,%xmm4
|
||||
.byte 102,15,56,0,195
|
||||
movdqa 64(%r11,%r10,1),%xmm1
|
||||
pxor %xmm4,%xmm0
|
||||
.byte 102,15,56,0,193
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size _vpaes_encrypt_core,.-_vpaes_encrypt_core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.type _vpaes_decrypt_core,@function
|
||||
.align 16
|
||||
_vpaes_decrypt_core:
|
||||
.cfi_startproc
|
||||
movq %rdx,%r9
|
||||
movl 240(%rdx),%eax
|
||||
movdqa %xmm9,%xmm1
|
||||
movdqa .Lk_dipt(%rip),%xmm2
|
||||
pandn %xmm0,%xmm1
|
||||
movq %rax,%r11
|
||||
psrld $4,%xmm1
|
||||
movdqu (%r9),%xmm5
|
||||
shlq $4,%r11
|
||||
pand %xmm9,%xmm0
|
||||
.byte 102,15,56,0,208
|
||||
movdqa .Lk_dipt+16(%rip),%xmm0
|
||||
xorq $0x30,%r11
|
||||
leaq .Lk_dsbd(%rip),%r10
|
||||
.byte 102,15,56,0,193
|
||||
andq $0x30,%r11
|
||||
pxor %xmm5,%xmm2
|
||||
movdqa .Lk_mc_forward+48(%rip),%xmm5
|
||||
pxor %xmm2,%xmm0
|
||||
addq $16,%r9
|
||||
addq %r10,%r11
|
||||
jmp .Ldec_entry
|
||||
|
||||
.align 16
|
||||
.Ldec_loop:
|
||||
|
||||
|
||||
|
||||
movdqa -32(%r10),%xmm4
|
||||
movdqa -16(%r10),%xmm1
|
||||
.byte 102,15,56,0,226
|
||||
.byte 102,15,56,0,203
|
||||
pxor %xmm4,%xmm0
|
||||
movdqa 0(%r10),%xmm4
|
||||
pxor %xmm1,%xmm0
|
||||
movdqa 16(%r10),%xmm1
|
||||
|
||||
.byte 102,15,56,0,226
|
||||
.byte 102,15,56,0,197
|
||||
.byte 102,15,56,0,203
|
||||
pxor %xmm4,%xmm0
|
||||
movdqa 32(%r10),%xmm4
|
||||
pxor %xmm1,%xmm0
|
||||
movdqa 48(%r10),%xmm1
|
||||
|
||||
.byte 102,15,56,0,226
|
||||
.byte 102,15,56,0,197
|
||||
.byte 102,15,56,0,203
|
||||
pxor %xmm4,%xmm0
|
||||
movdqa 64(%r10),%xmm4
|
||||
pxor %xmm1,%xmm0
|
||||
movdqa 80(%r10),%xmm1
|
||||
|
||||
.byte 102,15,56,0,226
|
||||
.byte 102,15,56,0,197
|
||||
.byte 102,15,56,0,203
|
||||
pxor %xmm4,%xmm0
|
||||
addq $16,%r9
|
||||
.byte 102,15,58,15,237,12
|
||||
pxor %xmm1,%xmm0
|
||||
subq $1,%rax
|
||||
|
||||
.Ldec_entry:
|
||||
|
||||
movdqa %xmm9,%xmm1
|
||||
pandn %xmm0,%xmm1
|
||||
movdqa %xmm11,%xmm2
|
||||
psrld $4,%xmm1
|
||||
pand %xmm9,%xmm0
|
||||
.byte 102,15,56,0,208
|
||||
movdqa %xmm10,%xmm3
|
||||
pxor %xmm1,%xmm0
|
||||
.byte 102,15,56,0,217
|
||||
movdqa %xmm10,%xmm4
|
||||
pxor %xmm2,%xmm3
|
||||
.byte 102,15,56,0,224
|
||||
pxor %xmm2,%xmm4
|
||||
movdqa %xmm10,%xmm2
|
||||
.byte 102,15,56,0,211
|
||||
movdqa %xmm10,%xmm3
|
||||
pxor %xmm0,%xmm2
|
||||
.byte 102,15,56,0,220
|
||||
movdqu (%r9),%xmm0
|
||||
pxor %xmm1,%xmm3
|
||||
jnz .Ldec_loop
|
||||
|
||||
|
||||
movdqa 96(%r10),%xmm4
|
||||
.byte 102,15,56,0,226
|
||||
pxor %xmm0,%xmm4
|
||||
movdqa 112(%r10),%xmm0
|
||||
movdqa -352(%r11),%xmm2
|
||||
.byte 102,15,56,0,195
|
||||
pxor %xmm4,%xmm0
|
||||
.byte 102,15,56,0,194
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size _vpaes_decrypt_core,.-_vpaes_decrypt_core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.type _vpaes_schedule_core,@function
|
||||
.align 16
|
||||
_vpaes_schedule_core:
|
||||
.cfi_startproc
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
call _vpaes_preheat
|
||||
movdqa .Lk_rcon(%rip),%xmm8
|
||||
movdqu (%rdi),%xmm0
|
||||
|
||||
|
||||
movdqa %xmm0,%xmm3
|
||||
leaq .Lk_ipt(%rip),%r11
|
||||
call _vpaes_schedule_transform
|
||||
movdqa %xmm0,%xmm7
|
||||
|
||||
leaq .Lk_sr(%rip),%r10
|
||||
testq %rcx,%rcx
|
||||
jnz .Lschedule_am_decrypting
|
||||
|
||||
|
||||
movdqu %xmm0,(%rdx)
|
||||
jmp .Lschedule_go
|
||||
|
||||
.Lschedule_am_decrypting:
|
||||
|
||||
movdqa (%r8,%r10,1),%xmm1
|
||||
.byte 102,15,56,0,217
|
||||
movdqu %xmm3,(%rdx)
|
||||
xorq $0x30,%r8
|
||||
|
||||
.Lschedule_go:
|
||||
cmpl $192,%esi
|
||||
ja .Lschedule_256
|
||||
je .Lschedule_192
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.Lschedule_128:
|
||||
movl $10,%esi
|
||||
|
||||
.Loop_schedule_128:
|
||||
call _vpaes_schedule_round
|
||||
decq %rsi
|
||||
jz .Lschedule_mangle_last
|
||||
call _vpaes_schedule_mangle
|
||||
jmp .Loop_schedule_128
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.align 16
|
||||
.Lschedule_192:
|
||||
movdqu 8(%rdi),%xmm0
|
||||
call _vpaes_schedule_transform
|
||||
movdqa %xmm0,%xmm6
|
||||
pxor %xmm4,%xmm4
|
||||
movhlps %xmm4,%xmm6
|
||||
movl $4,%esi
|
||||
|
||||
.Loop_schedule_192:
|
||||
call _vpaes_schedule_round
|
||||
.byte 102,15,58,15,198,8
|
||||
call _vpaes_schedule_mangle
|
||||
call _vpaes_schedule_192_smear
|
||||
call _vpaes_schedule_mangle
|
||||
call _vpaes_schedule_round
|
||||
decq %rsi
|
||||
jz .Lschedule_mangle_last
|
||||
call _vpaes_schedule_mangle
|
||||
call _vpaes_schedule_192_smear
|
||||
jmp .Loop_schedule_192
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.align 16
|
||||
.Lschedule_256:
|
||||
movdqu 16(%rdi),%xmm0
|
||||
call _vpaes_schedule_transform
|
||||
movl $7,%esi
|
||||
|
||||
.Loop_schedule_256:
|
||||
call _vpaes_schedule_mangle
|
||||
movdqa %xmm0,%xmm6
|
||||
|
||||
|
||||
call _vpaes_schedule_round
|
||||
decq %rsi
|
||||
jz .Lschedule_mangle_last
|
||||
call _vpaes_schedule_mangle
|
||||
|
||||
|
||||
pshufd $0xFF,%xmm0,%xmm0
|
||||
movdqa %xmm7,%xmm5
|
||||
movdqa %xmm6,%xmm7
|
||||
call _vpaes_schedule_low_round
|
||||
movdqa %xmm5,%xmm7
|
||||
|
||||
jmp .Loop_schedule_256
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.align 16
|
||||
.Lschedule_mangle_last:
|
||||
|
||||
leaq .Lk_deskew(%rip),%r11
|
||||
testq %rcx,%rcx
|
||||
jnz .Lschedule_mangle_last_dec
|
||||
|
||||
|
||||
movdqa (%r8,%r10,1),%xmm1
|
||||
.byte 102,15,56,0,193
|
||||
leaq .Lk_opt(%rip),%r11
|
||||
addq $32,%rdx
|
||||
|
||||
.Lschedule_mangle_last_dec:
|
||||
addq $-16,%rdx
|
||||
pxor .Lk_s63(%rip),%xmm0
|
||||
call _vpaes_schedule_transform
|
||||
movdqu %xmm0,(%rdx)
|
||||
|
||||
|
||||
pxor %xmm0,%xmm0
|
||||
pxor %xmm1,%xmm1
|
||||
pxor %xmm2,%xmm2
|
||||
pxor %xmm3,%xmm3
|
||||
pxor %xmm4,%xmm4
|
||||
pxor %xmm5,%xmm5
|
||||
pxor %xmm6,%xmm6
|
||||
pxor %xmm7,%xmm7
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size _vpaes_schedule_core,.-_vpaes_schedule_core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.type _vpaes_schedule_192_smear,@function
|
||||
.align 16
|
||||
_vpaes_schedule_192_smear:
|
||||
.cfi_startproc
|
||||
pshufd $0x80,%xmm6,%xmm1
|
||||
pshufd $0xFE,%xmm7,%xmm0
|
||||
pxor %xmm1,%xmm6
|
||||
pxor %xmm1,%xmm1
|
||||
pxor %xmm0,%xmm6
|
||||
movdqa %xmm6,%xmm0
|
||||
movhlps %xmm1,%xmm6
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size _vpaes_schedule_192_smear,.-_vpaes_schedule_192_smear
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.type _vpaes_schedule_round,@function
|
||||
.align 16
|
||||
_vpaes_schedule_round:
|
||||
.cfi_startproc
|
||||
|
||||
pxor %xmm1,%xmm1
|
||||
.byte 102,65,15,58,15,200,15
|
||||
.byte 102,69,15,58,15,192,15
|
||||
pxor %xmm1,%xmm7
|
||||
|
||||
|
||||
pshufd $0xFF,%xmm0,%xmm0
|
||||
.byte 102,15,58,15,192,1
|
||||
|
||||
|
||||
|
||||
|
||||
_vpaes_schedule_low_round:
|
||||
|
||||
movdqa %xmm7,%xmm1
|
||||
pslldq $4,%xmm7
|
||||
pxor %xmm1,%xmm7
|
||||
movdqa %xmm7,%xmm1
|
||||
pslldq $8,%xmm7
|
||||
pxor %xmm1,%xmm7
|
||||
pxor .Lk_s63(%rip),%xmm7
|
||||
|
||||
|
||||
movdqa %xmm9,%xmm1
|
||||
pandn %xmm0,%xmm1
|
||||
psrld $4,%xmm1
|
||||
pand %xmm9,%xmm0
|
||||
movdqa %xmm11,%xmm2
|
||||
.byte 102,15,56,0,208
|
||||
pxor %xmm1,%xmm0
|
||||
movdqa %xmm10,%xmm3
|
||||
.byte 102,15,56,0,217
|
||||
pxor %xmm2,%xmm3
|
||||
movdqa %xmm10,%xmm4
|
||||
.byte 102,15,56,0,224
|
||||
pxor %xmm2,%xmm4
|
||||
movdqa %xmm10,%xmm2
|
||||
.byte 102,15,56,0,211
|
||||
pxor %xmm0,%xmm2
|
||||
movdqa %xmm10,%xmm3
|
||||
.byte 102,15,56,0,220
|
||||
pxor %xmm1,%xmm3
|
||||
movdqa %xmm13,%xmm4
|
||||
.byte 102,15,56,0,226
|
||||
movdqa %xmm12,%xmm0
|
||||
.byte 102,15,56,0,195
|
||||
pxor %xmm4,%xmm0
|
||||
|
||||
|
||||
pxor %xmm7,%xmm0
|
||||
movdqa %xmm0,%xmm7
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size _vpaes_schedule_round,.-_vpaes_schedule_round
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.type _vpaes_schedule_transform,@function
|
||||
.align 16
|
||||
_vpaes_schedule_transform:
|
||||
.cfi_startproc
|
||||
movdqa %xmm9,%xmm1
|
||||
pandn %xmm0,%xmm1
|
||||
psrld $4,%xmm1
|
||||
pand %xmm9,%xmm0
|
||||
movdqa (%r11),%xmm2
|
||||
.byte 102,15,56,0,208
|
||||
movdqa 16(%r11),%xmm0
|
||||
.byte 102,15,56,0,193
|
||||
pxor %xmm2,%xmm0
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size _vpaes_schedule_transform,.-_vpaes_schedule_transform
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.type _vpaes_schedule_mangle,@function
|
||||
.align 16
|
||||
_vpaes_schedule_mangle:
|
||||
.cfi_startproc
|
||||
movdqa %xmm0,%xmm4
|
||||
movdqa .Lk_mc_forward(%rip),%xmm5
|
||||
testq %rcx,%rcx
|
||||
jnz .Lschedule_mangle_dec
|
||||
|
||||
|
||||
addq $16,%rdx
|
||||
pxor .Lk_s63(%rip),%xmm4
|
||||
.byte 102,15,56,0,229
|
||||
movdqa %xmm4,%xmm3
|
||||
.byte 102,15,56,0,229
|
||||
pxor %xmm4,%xmm3
|
||||
.byte 102,15,56,0,229
|
||||
pxor %xmm4,%xmm3
|
||||
|
||||
jmp .Lschedule_mangle_both
|
||||
.align 16
|
||||
.Lschedule_mangle_dec:
|
||||
|
||||
leaq .Lk_dksd(%rip),%r11
|
||||
movdqa %xmm9,%xmm1
|
||||
pandn %xmm4,%xmm1
|
||||
psrld $4,%xmm1
|
||||
pand %xmm9,%xmm4
|
||||
|
||||
movdqa 0(%r11),%xmm2
|
||||
.byte 102,15,56,0,212
|
||||
movdqa 16(%r11),%xmm3
|
||||
.byte 102,15,56,0,217
|
||||
pxor %xmm2,%xmm3
|
||||
.byte 102,15,56,0,221
|
||||
|
||||
movdqa 32(%r11),%xmm2
|
||||
.byte 102,15,56,0,212
|
||||
pxor %xmm3,%xmm2
|
||||
movdqa 48(%r11),%xmm3
|
||||
.byte 102,15,56,0,217
|
||||
pxor %xmm2,%xmm3
|
||||
.byte 102,15,56,0,221
|
||||
|
||||
movdqa 64(%r11),%xmm2
|
||||
.byte 102,15,56,0,212
|
||||
pxor %xmm3,%xmm2
|
||||
movdqa 80(%r11),%xmm3
|
||||
.byte 102,15,56,0,217
|
||||
pxor %xmm2,%xmm3
|
||||
.byte 102,15,56,0,221
|
||||
|
||||
movdqa 96(%r11),%xmm2
|
||||
.byte 102,15,56,0,212
|
||||
pxor %xmm3,%xmm2
|
||||
movdqa 112(%r11),%xmm3
|
||||
.byte 102,15,56,0,217
|
||||
pxor %xmm2,%xmm3
|
||||
|
||||
addq $-16,%rdx
|
||||
|
||||
.Lschedule_mangle_both:
|
||||
movdqa (%r8,%r10,1),%xmm1
|
||||
.byte 102,15,56,0,217
|
||||
addq $-16,%r8
|
||||
andq $0x30,%r8
|
||||
movdqu %xmm3,(%rdx)
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size _vpaes_schedule_mangle,.-_vpaes_schedule_mangle
|
||||
|
||||
|
||||
|
||||
|
||||
.globl vpaes_set_encrypt_key
|
||||
.type vpaes_set_encrypt_key,@function
|
||||
.align 16
|
||||
vpaes_set_encrypt_key:
|
||||
.cfi_startproc
|
||||
movl %esi,%eax
|
||||
shrl $5,%eax
|
||||
addl $5,%eax
|
||||
movl %eax,240(%rdx)
|
||||
|
||||
movl $0,%ecx
|
||||
movl $0x30,%r8d
|
||||
call _vpaes_schedule_core
|
||||
xorl %eax,%eax
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size vpaes_set_encrypt_key,.-vpaes_set_encrypt_key
|
||||
|
||||
.globl vpaes_set_decrypt_key
|
||||
.type vpaes_set_decrypt_key,@function
|
||||
.align 16
|
||||
vpaes_set_decrypt_key:
|
||||
.cfi_startproc
|
||||
movl %esi,%eax
|
||||
shrl $5,%eax
|
||||
addl $5,%eax
|
||||
movl %eax,240(%rdx)
|
||||
shll $4,%eax
|
||||
leaq 16(%rdx,%rax,1),%rdx
|
||||
|
||||
movl $1,%ecx
|
||||
movl %esi,%r8d
|
||||
shrl $1,%r8d
|
||||
andl $32,%r8d
|
||||
xorl $32,%r8d
|
||||
call _vpaes_schedule_core
|
||||
xorl %eax,%eax
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size vpaes_set_decrypt_key,.-vpaes_set_decrypt_key
|
||||
|
||||
.globl vpaes_encrypt
|
||||
.type vpaes_encrypt,@function
|
||||
.align 16
|
||||
vpaes_encrypt:
|
||||
.cfi_startproc
|
||||
movdqu (%rdi),%xmm0
|
||||
call _vpaes_preheat
|
||||
call _vpaes_encrypt_core
|
||||
movdqu %xmm0,(%rsi)
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size vpaes_encrypt,.-vpaes_encrypt
|
||||
|
||||
.globl vpaes_decrypt
|
||||
.type vpaes_decrypt,@function
|
||||
.align 16
|
||||
vpaes_decrypt:
|
||||
.cfi_startproc
|
||||
movdqu (%rdi),%xmm0
|
||||
call _vpaes_preheat
|
||||
call _vpaes_decrypt_core
|
||||
movdqu %xmm0,(%rsi)
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size vpaes_decrypt,.-vpaes_decrypt
|
||||
.globl vpaes_cbc_encrypt
|
||||
.type vpaes_cbc_encrypt,@function
|
||||
.align 16
|
||||
vpaes_cbc_encrypt:
|
||||
.cfi_startproc
|
||||
xchgq %rcx,%rdx
|
||||
subq $16,%rcx
|
||||
jc .Lcbc_abort
|
||||
movdqu (%r8),%xmm6
|
||||
subq %rdi,%rsi
|
||||
call _vpaes_preheat
|
||||
cmpl $0,%r9d
|
||||
je .Lcbc_dec_loop
|
||||
jmp .Lcbc_enc_loop
|
||||
.align 16
|
||||
.Lcbc_enc_loop:
|
||||
movdqu (%rdi),%xmm0
|
||||
pxor %xmm6,%xmm0
|
||||
call _vpaes_encrypt_core
|
||||
movdqa %xmm0,%xmm6
|
||||
movdqu %xmm0,(%rsi,%rdi,1)
|
||||
leaq 16(%rdi),%rdi
|
||||
subq $16,%rcx
|
||||
jnc .Lcbc_enc_loop
|
||||
jmp .Lcbc_done
|
||||
.align 16
|
||||
.Lcbc_dec_loop:
|
||||
movdqu (%rdi),%xmm0
|
||||
movdqa %xmm0,%xmm7
|
||||
call _vpaes_decrypt_core
|
||||
pxor %xmm6,%xmm0
|
||||
movdqa %xmm7,%xmm6
|
||||
movdqu %xmm0,(%rsi,%rdi,1)
|
||||
leaq 16(%rdi),%rdi
|
||||
subq $16,%rcx
|
||||
jnc .Lcbc_dec_loop
|
||||
.Lcbc_done:
|
||||
movdqu %xmm6,(%r8)
|
||||
.Lcbc_abort:
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size vpaes_cbc_encrypt,.-vpaes_cbc_encrypt
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.type _vpaes_preheat,@function
|
||||
.align 16
|
||||
_vpaes_preheat:
|
||||
.cfi_startproc
|
||||
leaq .Lk_s0F(%rip),%r10
|
||||
movdqa -32(%r10),%xmm10
|
||||
movdqa -16(%r10),%xmm11
|
||||
movdqa 0(%r10),%xmm9
|
||||
movdqa 48(%r10),%xmm13
|
||||
movdqa 64(%r10),%xmm12
|
||||
movdqa 80(%r10),%xmm15
|
||||
movdqa 96(%r10),%xmm14
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size _vpaes_preheat,.-_vpaes_preheat
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.type _vpaes_consts,@object
|
||||
.align 64
|
||||
_vpaes_consts:
|
||||
.Lk_inv:
|
||||
.quad 0x0E05060F0D080180, 0x040703090A0B0C02
|
||||
.quad 0x01040A060F0B0780, 0x030D0E0C02050809
|
||||
|
||||
.Lk_s0F:
|
||||
.quad 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F
|
||||
|
||||
.Lk_ipt:
|
||||
.quad 0xC2B2E8985A2A7000, 0xCABAE09052227808
|
||||
.quad 0x4C01307D317C4D00, 0xCD80B1FCB0FDCC81
|
||||
|
||||
.Lk_sb1:
|
||||
.quad 0xB19BE18FCB503E00, 0xA5DF7A6E142AF544
|
||||
.quad 0x3618D415FAE22300, 0x3BF7CCC10D2ED9EF
|
||||
.Lk_sb2:
|
||||
.quad 0xE27A93C60B712400, 0x5EB7E955BC982FCD
|
||||
.quad 0x69EB88400AE12900, 0xC2A163C8AB82234A
|
||||
.Lk_sbo:
|
||||
.quad 0xD0D26D176FBDC700, 0x15AABF7AC502A878
|
||||
.quad 0xCFE474A55FBB6A00, 0x8E1E90D1412B35FA
|
||||
|
||||
.Lk_mc_forward:
|
||||
.quad 0x0407060500030201, 0x0C0F0E0D080B0A09
|
||||
.quad 0x080B0A0904070605, 0x000302010C0F0E0D
|
||||
.quad 0x0C0F0E0D080B0A09, 0x0407060500030201
|
||||
.quad 0x000302010C0F0E0D, 0x080B0A0904070605
|
||||
|
||||
.Lk_mc_backward:
|
||||
.quad 0x0605040702010003, 0x0E0D0C0F0A09080B
|
||||
.quad 0x020100030E0D0C0F, 0x0A09080B06050407
|
||||
.quad 0x0E0D0C0F0A09080B, 0x0605040702010003
|
||||
.quad 0x0A09080B06050407, 0x020100030E0D0C0F
|
||||
|
||||
.Lk_sr:
|
||||
.quad 0x0706050403020100, 0x0F0E0D0C0B0A0908
|
||||
.quad 0x030E09040F0A0500, 0x0B06010C07020D08
|
||||
.quad 0x0F060D040B020900, 0x070E050C030A0108
|
||||
.quad 0x0B0E0104070A0D00, 0x0306090C0F020508
|
||||
|
||||
.Lk_rcon:
|
||||
.quad 0x1F8391B9AF9DEEB6, 0x702A98084D7C7D81
|
||||
|
||||
.Lk_s63:
|
||||
.quad 0x5B5B5B5B5B5B5B5B, 0x5B5B5B5B5B5B5B5B
|
||||
|
||||
.Lk_opt:
|
||||
.quad 0xFF9F4929D6B66000, 0xF7974121DEBE6808
|
||||
.quad 0x01EDBD5150BCEC00, 0xE10D5DB1B05C0CE0
|
||||
|
||||
.Lk_deskew:
|
||||
.quad 0x07E4A34047A4E300, 0x1DFEB95A5DBEF91A
|
||||
.quad 0x5F36B5DC83EA6900, 0x2841C2ABF49D1E77
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.Lk_dksd:
|
||||
.quad 0xFEB91A5DA3E44700, 0x0740E3A45A1DBEF9
|
||||
.quad 0x41C277F4B5368300, 0x5FDC69EAAB289D1E
|
||||
.Lk_dksb:
|
||||
.quad 0x9A4FCA1F8550D500, 0x03D653861CC94C99
|
||||
.quad 0x115BEDA7B6FC4A00, 0xD993256F7E3482C8
|
||||
.Lk_dkse:
|
||||
.quad 0xD5031CCA1FC9D600, 0x53859A4C994F5086
|
||||
.quad 0xA23196054FDC7BE8, 0xCD5EF96A20B31487
|
||||
.Lk_dks9:
|
||||
.quad 0xB6116FC87ED9A700, 0x4AED933482255BFC
|
||||
.quad 0x4576516227143300, 0x8BB89FACE9DAFDCE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.Lk_dipt:
|
||||
.quad 0x0F505B040B545F00, 0x154A411E114E451A
|
||||
.quad 0x86E383E660056500, 0x12771772F491F194
|
||||
|
||||
.Lk_dsb9:
|
||||
.quad 0x851C03539A86D600, 0xCAD51F504F994CC9
|
||||
.quad 0xC03B1789ECD74900, 0x725E2C9EB2FBA565
|
||||
.Lk_dsbd:
|
||||
.quad 0x7D57CCDFE6B1A200, 0xF56E9B13882A4439
|
||||
.quad 0x3CE2FAF724C6CB00, 0x2931180D15DEEFD3
|
||||
.Lk_dsbb:
|
||||
.quad 0xD022649296B44200, 0x602646F6B0F2D404
|
||||
.quad 0xC19498A6CD596700, 0xF3FF0C3E3255AA6B
|
||||
.Lk_dsbe:
|
||||
.quad 0x46F2929626D4D000, 0x2242600464B4F6B0
|
||||
.quad 0x0C55A6CDFFAAC100, 0x9467F36B98593E32
|
||||
.Lk_dsbo:
|
||||
.quad 0x1387EA537EF94000, 0xC7AA6DB9D4943E2D
|
||||
.quad 0x12D7560F93441D00, 0xCA4B8159D8C58E9C
|
||||
.byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0
|
||||
.align 64
|
||||
.size _vpaes_consts,.-_vpaes_consts
|
@ -0,0 +1,29 @@
|
||||
# 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
|
||||
|
||||
.text
|
||||
|
||||
.globl aesni_gcm_encrypt
|
||||
.type aesni_gcm_encrypt,@function
|
||||
aesni_gcm_encrypt:
|
||||
.cfi_startproc
|
||||
xorl %eax,%eax
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size aesni_gcm_encrypt,.-aesni_gcm_encrypt
|
||||
|
||||
.globl aesni_gcm_decrypt
|
||||
.type aesni_gcm_decrypt,@function
|
||||
aesni_gcm_decrypt:
|
||||
.cfi_startproc
|
||||
xorl %eax,%eax
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size aesni_gcm_decrypt,.-aesni_gcm_decrypt
|
1386
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/modes/ghash-x86_64.S
Normal file
1386
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/modes/ghash-x86_64.S
Normal file
File diff suppressed because it is too large
Load Diff
2962
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha1-mb-x86_64.S
Normal file
2962
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha1-mb-x86_64.S
Normal file
File diff suppressed because it is too large
Load Diff
2631
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha1-x86_64.S
Normal file
2631
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha1-x86_64.S
Normal file
File diff suppressed because it is too large
Load Diff
3286
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha256-mb-x86_64.S
Normal file
3286
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha256-mb-x86_64.S
Normal file
File diff suppressed because it is too large
Load Diff
3097
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha256-x86_64.S
Normal file
3097
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha256-x86_64.S
Normal file
File diff suppressed because it is too large
Load Diff
1811
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha512-x86_64.S
Normal file
1811
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/sha/sha512-x86_64.S
Normal file
File diff suppressed because it is too large
Load Diff
491
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/x86_64cpuid.S
Normal file
491
CryptoPkg/Library/OpensslLib/X64Gcc/crypto/x86_64cpuid.S
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
|
||||
|
||||
|
||||
.hidden OPENSSL_cpuid_setup
|
||||
.section .init
|
||||
call OPENSSL_cpuid_setup
|
||||
|
||||
.hidden OPENSSL_ia32cap_P
|
||||
.comm OPENSSL_ia32cap_P,16,4
|
||||
|
||||
.text
|
||||
|
||||
.globl OPENSSL_atomic_add
|
||||
.type OPENSSL_atomic_add,@function
|
||||
.align 16
|
||||
OPENSSL_atomic_add:
|
||||
.cfi_startproc
|
||||
movl (%rdi),%eax
|
||||
.Lspin: leaq (%rsi,%rax,1),%r8
|
||||
.byte 0xf0
|
||||
cmpxchgl %r8d,(%rdi)
|
||||
jne .Lspin
|
||||
movl %r8d,%eax
|
||||
.byte 0x48,0x98
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size OPENSSL_atomic_add,.-OPENSSL_atomic_add
|
||||
|
||||
.globl OPENSSL_rdtsc
|
||||
.type OPENSSL_rdtsc,@function
|
||||
.align 16
|
||||
OPENSSL_rdtsc:
|
||||
.cfi_startproc
|
||||
rdtsc
|
||||
shlq $32,%rdx
|
||||
orq %rdx,%rax
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size OPENSSL_rdtsc,.-OPENSSL_rdtsc
|
||||
|
||||
.globl OPENSSL_ia32_cpuid
|
||||
.type OPENSSL_ia32_cpuid,@function
|
||||
.align 16
|
||||
OPENSSL_ia32_cpuid:
|
||||
.cfi_startproc
|
||||
movq %rbx,%r8
|
||||
.cfi_register %rbx,%r8
|
||||
|
||||
xorl %eax,%eax
|
||||
movq %rax,8(%rdi)
|
||||
cpuid
|
||||
movl %eax,%r11d
|
||||
|
||||
xorl %eax,%eax
|
||||
cmpl $0x756e6547,%ebx
|
||||
setne %al
|
||||
movl %eax,%r9d
|
||||
cmpl $0x49656e69,%edx
|
||||
setne %al
|
||||
orl %eax,%r9d
|
||||
cmpl $0x6c65746e,%ecx
|
||||
setne %al
|
||||
orl %eax,%r9d
|
||||
jz .Lintel
|
||||
|
||||
cmpl $0x68747541,%ebx
|
||||
setne %al
|
||||
movl %eax,%r10d
|
||||
cmpl $0x69746E65,%edx
|
||||
setne %al
|
||||
orl %eax,%r10d
|
||||
cmpl $0x444D4163,%ecx
|
||||
setne %al
|
||||
orl %eax,%r10d
|
||||
jnz .Lintel
|
||||
|
||||
|
||||
movl $0x80000000,%eax
|
||||
cpuid
|
||||
cmpl $0x80000001,%eax
|
||||
jb .Lintel
|
||||
movl %eax,%r10d
|
||||
movl $0x80000001,%eax
|
||||
cpuid
|
||||
orl %ecx,%r9d
|
||||
andl $0x00000801,%r9d
|
||||
|
||||
cmpl $0x80000008,%r10d
|
||||
jb .Lintel
|
||||
|
||||
movl $0x80000008,%eax
|
||||
cpuid
|
||||
movzbq %cl,%r10
|
||||
incq %r10
|
||||
|
||||
movl $1,%eax
|
||||
cpuid
|
||||
btl $28,%edx
|
||||
jnc .Lgeneric
|
||||
shrl $16,%ebx
|
||||
cmpb %r10b,%bl
|
||||
ja .Lgeneric
|
||||
andl $0xefffffff,%edx
|
||||
jmp .Lgeneric
|
||||
|
||||
.Lintel:
|
||||
cmpl $4,%r11d
|
||||
movl $-1,%r10d
|
||||
jb .Lnocacheinfo
|
||||
|
||||
movl $4,%eax
|
||||
movl $0,%ecx
|
||||
cpuid
|
||||
movl %eax,%r10d
|
||||
shrl $14,%r10d
|
||||
andl $0xfff,%r10d
|
||||
|
||||
.Lnocacheinfo:
|
||||
movl $1,%eax
|
||||
cpuid
|
||||
movd %eax,%xmm0
|
||||
andl $0xbfefffff,%edx
|
||||
cmpl $0,%r9d
|
||||
jne .Lnotintel
|
||||
orl $0x40000000,%edx
|
||||
andb $15,%ah
|
||||
cmpb $15,%ah
|
||||
jne .LnotP4
|
||||
orl $0x00100000,%edx
|
||||
.LnotP4:
|
||||
cmpb $6,%ah
|
||||
jne .Lnotintel
|
||||
andl $0x0fff0ff0,%eax
|
||||
cmpl $0x00050670,%eax
|
||||
je .Lknights
|
||||
cmpl $0x00080650,%eax
|
||||
jne .Lnotintel
|
||||
.Lknights:
|
||||
andl $0xfbffffff,%ecx
|
||||
|
||||
.Lnotintel:
|
||||
btl $28,%edx
|
||||
jnc .Lgeneric
|
||||
andl $0xefffffff,%edx
|
||||
cmpl $0,%r10d
|
||||
je .Lgeneric
|
||||
|
||||
orl $0x10000000,%edx
|
||||
shrl $16,%ebx
|
||||
cmpb $1,%bl
|
||||
ja .Lgeneric
|
||||
andl $0xefffffff,%edx
|
||||
.Lgeneric:
|
||||
andl $0x00000800,%r9d
|
||||
andl $0xfffff7ff,%ecx
|
||||
orl %ecx,%r9d
|
||||
|
||||
movl %edx,%r10d
|
||||
|
||||
cmpl $7,%r11d
|
||||
jb .Lno_extended_info
|
||||
movl $7,%eax
|
||||
xorl %ecx,%ecx
|
||||
cpuid
|
||||
btl $26,%r9d
|
||||
jc .Lnotknights
|
||||
andl $0xfff7ffff,%ebx
|
||||
.Lnotknights:
|
||||
movd %xmm0,%eax
|
||||
andl $0x0fff0ff0,%eax
|
||||
cmpl $0x00050650,%eax
|
||||
jne .Lnotskylakex
|
||||
andl $0xfffeffff,%ebx
|
||||
|
||||
.Lnotskylakex:
|
||||
movl %ebx,8(%rdi)
|
||||
movl %ecx,12(%rdi)
|
||||
.Lno_extended_info:
|
||||
|
||||
btl $27,%r9d
|
||||
jnc .Lclear_avx
|
||||
xorl %ecx,%ecx
|
||||
.byte 0x0f,0x01,0xd0
|
||||
andl $0xe6,%eax
|
||||
cmpl $0xe6,%eax
|
||||
je .Ldone
|
||||
andl $0x3fdeffff,8(%rdi)
|
||||
|
||||
|
||||
|
||||
|
||||
andl $6,%eax
|
||||
cmpl $6,%eax
|
||||
je .Ldone
|
||||
.Lclear_avx:
|
||||
movl $0xefffe7ff,%eax
|
||||
andl %eax,%r9d
|
||||
movl $0x3fdeffdf,%eax
|
||||
andl %eax,8(%rdi)
|
||||
.Ldone:
|
||||
shlq $32,%r9
|
||||
movl %r10d,%eax
|
||||
movq %r8,%rbx
|
||||
.cfi_restore %rbx
|
||||
orq %r9,%rax
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size OPENSSL_ia32_cpuid,.-OPENSSL_ia32_cpuid
|
||||
|
||||
.globl OPENSSL_cleanse
|
||||
.type OPENSSL_cleanse,@function
|
||||
.align 16
|
||||
OPENSSL_cleanse:
|
||||
.cfi_startproc
|
||||
xorq %rax,%rax
|
||||
cmpq $15,%rsi
|
||||
jae .Lot
|
||||
cmpq $0,%rsi
|
||||
je .Lret
|
||||
.Little:
|
||||
movb %al,(%rdi)
|
||||
subq $1,%rsi
|
||||
leaq 1(%rdi),%rdi
|
||||
jnz .Little
|
||||
.Lret:
|
||||
.byte 0xf3,0xc3
|
||||
.align 16
|
||||
.Lot:
|
||||
testq $7,%rdi
|
||||
jz .Laligned
|
||||
movb %al,(%rdi)
|
||||
leaq -1(%rsi),%rsi
|
||||
leaq 1(%rdi),%rdi
|
||||
jmp .Lot
|
||||
.Laligned:
|
||||
movq %rax,(%rdi)
|
||||
leaq -8(%rsi),%rsi
|
||||
testq $-8,%rsi
|
||||
leaq 8(%rdi),%rdi
|
||||
jnz .Laligned
|
||||
cmpq $0,%rsi
|
||||
jne .Little
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size OPENSSL_cleanse,.-OPENSSL_cleanse
|
||||
|
||||
.globl CRYPTO_memcmp
|
||||
.type CRYPTO_memcmp,@function
|
||||
.align 16
|
||||
CRYPTO_memcmp:
|
||||
.cfi_startproc
|
||||
xorq %rax,%rax
|
||||
xorq %r10,%r10
|
||||
cmpq $0,%rdx
|
||||
je .Lno_data
|
||||
cmpq $16,%rdx
|
||||
jne .Loop_cmp
|
||||
movq (%rdi),%r10
|
||||
movq 8(%rdi),%r11
|
||||
movq $1,%rdx
|
||||
xorq (%rsi),%r10
|
||||
xorq 8(%rsi),%r11
|
||||
orq %r11,%r10
|
||||
cmovnzq %rdx,%rax
|
||||
.byte 0xf3,0xc3
|
||||
|
||||
.align 16
|
||||
.Loop_cmp:
|
||||
movb (%rdi),%r10b
|
||||
leaq 1(%rdi),%rdi
|
||||
xorb (%rsi),%r10b
|
||||
leaq 1(%rsi),%rsi
|
||||
orb %r10b,%al
|
||||
decq %rdx
|
||||
jnz .Loop_cmp
|
||||
negq %rax
|
||||
shrq $63,%rax
|
||||
.Lno_data:
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size CRYPTO_memcmp,.-CRYPTO_memcmp
|
||||
.globl OPENSSL_wipe_cpu
|
||||
.type OPENSSL_wipe_cpu,@function
|
||||
.align 16
|
||||
OPENSSL_wipe_cpu:
|
||||
.cfi_startproc
|
||||
pxor %xmm0,%xmm0
|
||||
pxor %xmm1,%xmm1
|
||||
pxor %xmm2,%xmm2
|
||||
pxor %xmm3,%xmm3
|
||||
pxor %xmm4,%xmm4
|
||||
pxor %xmm5,%xmm5
|
||||
pxor %xmm6,%xmm6
|
||||
pxor %xmm7,%xmm7
|
||||
pxor %xmm8,%xmm8
|
||||
pxor %xmm9,%xmm9
|
||||
pxor %xmm10,%xmm10
|
||||
pxor %xmm11,%xmm11
|
||||
pxor %xmm12,%xmm12
|
||||
pxor %xmm13,%xmm13
|
||||
pxor %xmm14,%xmm14
|
||||
pxor %xmm15,%xmm15
|
||||
xorq %rcx,%rcx
|
||||
xorq %rdx,%rdx
|
||||
xorq %rsi,%rsi
|
||||
xorq %rdi,%rdi
|
||||
xorq %r8,%r8
|
||||
xorq %r9,%r9
|
||||
xorq %r10,%r10
|
||||
xorq %r11,%r11
|
||||
leaq 8(%rsp),%rax
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
|
||||
.globl OPENSSL_instrument_bus
|
||||
.type OPENSSL_instrument_bus,@function
|
||||
.align 16
|
||||
OPENSSL_instrument_bus:
|
||||
.cfi_startproc
|
||||
movq %rdi,%r10
|
||||
movq %rsi,%rcx
|
||||
movq %rsi,%r11
|
||||
|
||||
rdtsc
|
||||
movl %eax,%r8d
|
||||
movl $0,%r9d
|
||||
clflush (%r10)
|
||||
.byte 0xf0
|
||||
addl %r9d,(%r10)
|
||||
jmp .Loop
|
||||
.align 16
|
||||
.Loop: rdtsc
|
||||
movl %eax,%edx
|
||||
subl %r8d,%eax
|
||||
movl %edx,%r8d
|
||||
movl %eax,%r9d
|
||||
clflush (%r10)
|
||||
.byte 0xf0
|
||||
addl %eax,(%r10)
|
||||
leaq 4(%r10),%r10
|
||||
subq $1,%rcx
|
||||
jnz .Loop
|
||||
|
||||
movq %r11,%rax
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size OPENSSL_instrument_bus,.-OPENSSL_instrument_bus
|
||||
|
||||
.globl OPENSSL_instrument_bus2
|
||||
.type OPENSSL_instrument_bus2,@function
|
||||
.align 16
|
||||
OPENSSL_instrument_bus2:
|
||||
.cfi_startproc
|
||||
movq %rdi,%r10
|
||||
movq %rsi,%rcx
|
||||
movq %rdx,%r11
|
||||
movq %rcx,8(%rsp)
|
||||
|
||||
rdtsc
|
||||
movl %eax,%r8d
|
||||
movl $0,%r9d
|
||||
|
||||
clflush (%r10)
|
||||
.byte 0xf0
|
||||
addl %r9d,(%r10)
|
||||
|
||||
rdtsc
|
||||
movl %eax,%edx
|
||||
subl %r8d,%eax
|
||||
movl %edx,%r8d
|
||||
movl %eax,%r9d
|
||||
.Loop2:
|
||||
clflush (%r10)
|
||||
.byte 0xf0
|
||||
addl %eax,(%r10)
|
||||
|
||||
subq $1,%r11
|
||||
jz .Ldone2
|
||||
|
||||
rdtsc
|
||||
movl %eax,%edx
|
||||
subl %r8d,%eax
|
||||
movl %edx,%r8d
|
||||
cmpl %r9d,%eax
|
||||
movl %eax,%r9d
|
||||
movl $0,%edx
|
||||
setne %dl
|
||||
subq %rdx,%rcx
|
||||
leaq (%r10,%rdx,4),%r10
|
||||
jnz .Loop2
|
||||
|
||||
.Ldone2:
|
||||
movq 8(%rsp),%rax
|
||||
subq %rcx,%rax
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size OPENSSL_instrument_bus2,.-OPENSSL_instrument_bus2
|
||||
.globl OPENSSL_ia32_rdrand_bytes
|
||||
.type OPENSSL_ia32_rdrand_bytes,@function
|
||||
.align 16
|
||||
OPENSSL_ia32_rdrand_bytes:
|
||||
.cfi_startproc
|
||||
xorq %rax,%rax
|
||||
cmpq $0,%rsi
|
||||
je .Ldone_rdrand_bytes
|
||||
|
||||
movq $8,%r11
|
||||
.Loop_rdrand_bytes:
|
||||
.byte 73,15,199,242
|
||||
jc .Lbreak_rdrand_bytes
|
||||
decq %r11
|
||||
jnz .Loop_rdrand_bytes
|
||||
jmp .Ldone_rdrand_bytes
|
||||
|
||||
.align 16
|
||||
.Lbreak_rdrand_bytes:
|
||||
cmpq $8,%rsi
|
||||
jb .Ltail_rdrand_bytes
|
||||
movq %r10,(%rdi)
|
||||
leaq 8(%rdi),%rdi
|
||||
addq $8,%rax
|
||||
subq $8,%rsi
|
||||
jz .Ldone_rdrand_bytes
|
||||
movq $8,%r11
|
||||
jmp .Loop_rdrand_bytes
|
||||
|
||||
.align 16
|
||||
.Ltail_rdrand_bytes:
|
||||
movb %r10b,(%rdi)
|
||||
leaq 1(%rdi),%rdi
|
||||
incq %rax
|
||||
shrq $8,%r10
|
||||
decq %rsi
|
||||
jnz .Ltail_rdrand_bytes
|
||||
|
||||
.Ldone_rdrand_bytes:
|
||||
xorq %r10,%r10
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size OPENSSL_ia32_rdrand_bytes,.-OPENSSL_ia32_rdrand_bytes
|
||||
.globl OPENSSL_ia32_rdseed_bytes
|
||||
.type OPENSSL_ia32_rdseed_bytes,@function
|
||||
.align 16
|
||||
OPENSSL_ia32_rdseed_bytes:
|
||||
.cfi_startproc
|
||||
xorq %rax,%rax
|
||||
cmpq $0,%rsi
|
||||
je .Ldone_rdseed_bytes
|
||||
|
||||
movq $8,%r11
|
||||
.Loop_rdseed_bytes:
|
||||
.byte 73,15,199,250
|
||||
jc .Lbreak_rdseed_bytes
|
||||
decq %r11
|
||||
jnz .Loop_rdseed_bytes
|
||||
jmp .Ldone_rdseed_bytes
|
||||
|
||||
.align 16
|
||||
.Lbreak_rdseed_bytes:
|
||||
cmpq $8,%rsi
|
||||
jb .Ltail_rdseed_bytes
|
||||
movq %r10,(%rdi)
|
||||
leaq 8(%rdi),%rdi
|
||||
addq $8,%rax
|
||||
subq $8,%rsi
|
||||
jz .Ldone_rdseed_bytes
|
||||
movq $8,%r11
|
||||
jmp .Loop_rdseed_bytes
|
||||
|
||||
.align 16
|
||||
.Ltail_rdseed_bytes:
|
||||
movb %r10b,(%rdi)
|
||||
leaq 1(%rdi),%rdi
|
||||
incq %rax
|
||||
shrq $8,%r10
|
||||
decq %rsi
|
||||
jnz .Ltail_rdseed_bytes
|
||||
|
||||
.Ldone_rdseed_bytes:
|
||||
xorq %r10,%r10
|
||||
.byte 0xf3,0xc3
|
||||
.cfi_endproc
|
||||
.size OPENSSL_ia32_rdseed_bytes,.-OPENSSL_ia32_rdseed_bytes
|
Loading…
x
Reference in New Issue
Block a user