Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix wrong hash results on Windows with some CPUs that support Intel SHA Extension #12913

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions deps/openssl/asm/x64-win32-masm/aes/aesni-sha256-x86_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4150,7 +4150,7 @@ $L$prologue_shaext::
lea rcx,QWORD PTR[112+rcx]

pshufd xmm0,xmm1,01bh
pshufd xmm1,xmm1,1h
pshufd xmm1,xmm1,0b1h
pshufd xmm2,xmm2,01bh
movdqa xmm7,xmm3
DB 102,15,58,15,202,8
Expand Down Expand Up @@ -4475,9 +4475,9 @@ $L$aesenclast4::
lea rdi,QWORD PTR[64+rdi]
jnz $L$oop_shaext

pshufd xmm2,xmm2,1h
pshufd xmm2,xmm2,0b1h
pshufd xmm3,xmm1,01bh
pshufd xmm1,xmm1,1h
pshufd xmm1,xmm1,0b1h
punpckhqdq xmm1,xmm2
DB 102,15,58,15,211,8

Expand Down
16 changes: 8 additions & 8 deletions deps/openssl/asm/x64-win32-masm/ec/ecp_nistz256-x86_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ $L$SEH_begin_ecp_nistz256_point_add::
por xmm5,xmm4

movdqu xmm0,XMMWORD PTR[rsi]
pshufd xmm3,xmm5,1h
pshufd xmm3,xmm5,0b1h
movdqu xmm1,XMMWORD PTR[16+rsi]
movdqu xmm2,XMMWORD PTR[32+rsi]
por xmm5,xmm3
Expand Down Expand Up @@ -2081,7 +2081,7 @@ DB 102,72,15,110,199
call __ecp_nistz256_sqr_montq

pcmpeqd xmm5,xmm4
pshufd xmm4,xmm1,1h
pshufd xmm4,xmm1,0b1h
por xmm4,xmm1
pshufd xmm5,xmm5,0
pshufd xmm3,xmm4,01eh
Expand Down Expand Up @@ -2466,7 +2466,7 @@ $L$SEH_begin_ecp_nistz256_point_add_affine::
por xmm5,xmm4

movdqu xmm0,XMMWORD PTR[rbx]
pshufd xmm3,xmm5,1h
pshufd xmm3,xmm5,0b1h
movdqu xmm1,XMMWORD PTR[16+rbx]
movdqu xmm2,XMMWORD PTR[32+rbx]
por xmm5,xmm3
Expand All @@ -2488,7 +2488,7 @@ DB 102,72,15,110,199
call __ecp_nistz256_sqr_montq

pcmpeqd xmm5,xmm4
pshufd xmm4,xmm3,1h
pshufd xmm4,xmm3,0b1h
mov rax,QWORD PTR[rbx]

mov r9,r12
Expand Down Expand Up @@ -3117,7 +3117,7 @@ $L$point_addx::
por xmm5,xmm4

movdqu xmm0,XMMWORD PTR[rsi]
pshufd xmm3,xmm5,1h
pshufd xmm3,xmm5,0b1h
movdqu xmm1,XMMWORD PTR[16+rsi]
movdqu xmm2,XMMWORD PTR[32+rsi]
por xmm5,xmm3
Expand Down Expand Up @@ -3147,7 +3147,7 @@ DB 102,72,15,110,199
call __ecp_nistz256_sqr_montx

pcmpeqd xmm5,xmm4
pshufd xmm4,xmm1,1h
pshufd xmm4,xmm1,0b1h
por xmm4,xmm1
pshufd xmm5,xmm5,0
pshufd xmm3,xmm4,01eh
Expand Down Expand Up @@ -3528,7 +3528,7 @@ $L$point_add_affinex::
por xmm5,xmm4

movdqu xmm0,XMMWORD PTR[rbx]
pshufd xmm3,xmm5,1h
pshufd xmm3,xmm5,0b1h
movdqu xmm1,XMMWORD PTR[16+rbx]
movdqu xmm2,XMMWORD PTR[32+rbx]
por xmm5,xmm3
Expand All @@ -3550,7 +3550,7 @@ DB 102,72,15,110,199
call __ecp_nistz256_sqr_montx

pcmpeqd xmm5,xmm4
pshufd xmm4,xmm3,1h
pshufd xmm4,xmm3,0b1h
mov rdx,QWORD PTR[rbx]

mov r9,r12
Expand Down
6 changes: 3 additions & 3 deletions deps/openssl/asm/x64-win32-masm/sha/sha256-x86_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ $L$prologue_shaext::
movdqa xmm7,XMMWORD PTR[((512-128))+rcx]

pshufd xmm0,xmm1,01bh
pshufd xmm1,xmm1,1h
pshufd xmm1,xmm1,0b1h
pshufd xmm2,xmm2,01bh
movdqa xmm8,xmm7
DB 102,15,58,15,202,8
Expand Down Expand Up @@ -1983,9 +1983,9 @@ DB 15,56,203,202
paddd xmm1,xmm9
jnz $L$oop_shaext

pshufd xmm2,xmm2,1h
pshufd xmm2,xmm2,0b1h
pshufd xmm7,xmm1,01bh
pshufd xmm1,xmm1,1h
pshufd xmm1,xmm1,0b1h
punpckhqdq xmm1,xmm2
DB 102,15,58,15,215,8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ $L$SEH_begin_ecp_nistz256_point_add::
por xmm5,xmm4

movdqu xmm0,XMMWORD PTR[rsi]
pshufd xmm3,xmm5,1h
pshufd xmm3,xmm5,0b1h
movdqu xmm1,XMMWORD PTR[16+rsi]
movdqu xmm2,XMMWORD PTR[32+rsi]
por xmm5,xmm3
Expand Down Expand Up @@ -1567,7 +1567,7 @@ DB 102,72,15,110,199
call __ecp_nistz256_sqr_montq

pcmpeqd xmm5,xmm4
pshufd xmm4,xmm1,1h
pshufd xmm4,xmm1,0b1h
por xmm4,xmm1
pshufd xmm5,xmm5,0
pshufd xmm3,xmm4,01eh
Expand Down Expand Up @@ -1948,7 +1948,7 @@ $L$SEH_begin_ecp_nistz256_point_add_affine::
por xmm5,xmm4

movdqu xmm0,XMMWORD PTR[rbx]
pshufd xmm3,xmm5,1h
pshufd xmm3,xmm5,0b1h
movdqu xmm1,XMMWORD PTR[16+rbx]
movdqu xmm2,XMMWORD PTR[32+rbx]
por xmm5,xmm3
Expand All @@ -1970,7 +1970,7 @@ DB 102,72,15,110,199
call __ecp_nistz256_sqr_montq

pcmpeqd xmm5,xmm4
pshufd xmm4,xmm3,1h
pshufd xmm4,xmm3,0b1h
mov rax,QWORD PTR[rbx]

mov r9,r12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ $L$prologue_shaext::
movdqa xmm7,XMMWORD PTR[((512-128))+rcx]

pshufd xmm0,xmm1,01bh
pshufd xmm1,xmm1,1h
pshufd xmm1,xmm1,0b1h
pshufd xmm2,xmm2,01bh
movdqa xmm8,xmm7
DB 102,15,58,15,202,8
Expand Down Expand Up @@ -1975,9 +1975,9 @@ DB 15,56,203,202
paddd xmm1,xmm9
jnz $L$oop_shaext

pshufd xmm2,xmm2,1h
pshufd xmm2,xmm2,0b1h
pshufd xmm7,xmm1,01bh
pshufd xmm1,xmm1,1h
pshufd xmm1,xmm1,0b1h
punpckhqdq xmm1,xmm2
DB 102,15,58,15,215,8

Expand Down
5 changes: 3 additions & 2 deletions deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@
}
sprintf "\$%s",$self->{value};
} else {
$self->{value} =~ s/0x([0-9a-f]+)/0$1h/ig if ($masm);
sprintf "%s",$self->{value};
my $value = $self->{value};
$value =~ s/0x([0-9a-f]+)/0$1h/ig if ($masm);
sprintf "%s",$value;
}
}
}
Expand Down