diff options
author | jkim <jkim@FreeBSD.org> | 2016-05-03 18:50:10 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2016-05-03 18:50:10 +0000 |
commit | 00a878d06ed0d3bdfbf6339ef29f6cc94fd47ced (patch) | |
tree | 64905eaaef6c163463b7acbaca1a9724913735f5 /secure/lib/libcrypto/amd64 | |
parent | c052df1347dcbd00de507acf0cfa03733e795db5 (diff) | |
parent | acb827e3083196de4c00b67ac9ae3bf860ffd4a9 (diff) | |
download | FreeBSD-src-00a878d06ed0d3bdfbf6339ef29f6cc94fd47ced.zip FreeBSD-src-00a878d06ed0d3bdfbf6339ef29f6cc94fd47ced.tar.gz |
Merge OpenSSL 1.0.2h.
Relnotes: yes
Diffstat (limited to 'secure/lib/libcrypto/amd64')
-rw-r--r-- | secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S | 8 | ||||
-rw-r--r-- | secure/lib/libcrypto/amd64/aesni-x86_64.S | 30 | ||||
-rw-r--r-- | secure/lib/libcrypto/amd64/ghash-x86_64.S | 48 | ||||
-rw-r--r-- | secure/lib/libcrypto/amd64/sha1-mb-x86_64.S | 12 | ||||
-rw-r--r-- | secure/lib/libcrypto/amd64/sha1-x86_64.S | 8 | ||||
-rw-r--r-- | secure/lib/libcrypto/amd64/sha256-mb-x86_64.S | 16 | ||||
-rw-r--r-- | secure/lib/libcrypto/amd64/x86_64-mont.S | 31 | ||||
-rw-r--r-- | secure/lib/libcrypto/amd64/x86_64-mont5.S | 41 |
8 files changed, 133 insertions, 61 deletions
diff --git a/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S b/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S index 45a5e3b..fa16434 100644 --- a/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S +++ b/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S @@ -1393,8 +1393,8 @@ aesni_cbc_sha1_enc_shaext: movups 16(%rcx),%xmm0 leaq 112(%rcx),%rcx - pshufd $0b00011011,%xmm8,%xmm8 - pshufd $0b00011011,%xmm9,%xmm9 + pshufd $27,%xmm8,%xmm8 + pshufd $27,%xmm9,%xmm9 jmp .Loop_shaext .align 16 @@ -1673,8 +1673,8 @@ aesni_cbc_sha1_enc_shaext: leaq 64(%rdi),%rdi jnz .Loop_shaext - pshufd $0b00011011,%xmm8,%xmm8 - pshufd $0b00011011,%xmm9,%xmm9 + pshufd $27,%xmm8,%xmm8 + pshufd $27,%xmm9,%xmm9 movups %xmm2,(%r8) movdqu %xmm8,(%r9) movd %xmm9,16(%r9) diff --git a/secure/lib/libcrypto/amd64/aesni-x86_64.S b/secure/lib/libcrypto/amd64/aesni-x86_64.S index 5be8616..7e03808 100644 --- a/secure/lib/libcrypto/amd64/aesni-x86_64.S +++ b/secure/lib/libcrypto/amd64/aesni-x86_64.S @@ -3463,11 +3463,11 @@ __aesni_set_encrypt_key: movups %xmm0,(%rax) leaq 16(%rax),%rax .Lkey_expansion_128_cold: - shufps $0b00010000,%xmm0,%xmm4 + shufps $16,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $0b10001100,%xmm0,%xmm4 + shufps $140,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $0b11111111,%xmm1,%xmm1 + shufps $255,%xmm1,%xmm1 xorps %xmm1,%xmm0 .byte 0xf3,0xc3 @@ -3478,25 +3478,25 @@ __aesni_set_encrypt_key: .Lkey_expansion_192a_cold: movaps %xmm2,%xmm5 .Lkey_expansion_192b_warm: - shufps $0b00010000,%xmm0,%xmm4 + shufps $16,%xmm0,%xmm4 movdqa %xmm2,%xmm3 xorps %xmm4,%xmm0 - shufps $0b10001100,%xmm0,%xmm4 + shufps $140,%xmm0,%xmm4 pslldq $4,%xmm3 xorps %xmm4,%xmm0 - pshufd $0b01010101,%xmm1,%xmm1 + pshufd $85,%xmm1,%xmm1 pxor %xmm3,%xmm2 pxor %xmm1,%xmm0 - pshufd $0b11111111,%xmm0,%xmm3 + pshufd $255,%xmm0,%xmm3 pxor %xmm3,%xmm2 .byte 0xf3,0xc3 .align 16 .Lkey_expansion_192b: movaps %xmm0,%xmm3 - shufps $0b01000100,%xmm0,%xmm5 + shufps $68,%xmm0,%xmm5 movups %xmm5,(%rax) - shufps $0b01001110,%xmm2,%xmm3 + shufps $78,%xmm2,%xmm3 movups %xmm3,16(%rax) leaq 32(%rax),%rax jmp .Lkey_expansion_192b_warm @@ -3506,11 +3506,11 @@ __aesni_set_encrypt_key: movups %xmm2,(%rax) leaq 16(%rax),%rax .Lkey_expansion_256a_cold: - shufps $0b00010000,%xmm0,%xmm4 + shufps $16,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $0b10001100,%xmm0,%xmm4 + shufps $140,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $0b11111111,%xmm1,%xmm1 + shufps $255,%xmm1,%xmm1 xorps %xmm1,%xmm0 .byte 0xf3,0xc3 @@ -3519,11 +3519,11 @@ __aesni_set_encrypt_key: movups %xmm0,(%rax) leaq 16(%rax),%rax - shufps $0b00010000,%xmm2,%xmm4 + shufps $16,%xmm2,%xmm4 xorps %xmm4,%xmm2 - shufps $0b10001100,%xmm2,%xmm4 + shufps $140,%xmm2,%xmm4 xorps %xmm4,%xmm2 - shufps $0b10101010,%xmm1,%xmm1 + shufps $170,%xmm1,%xmm1 xorps %xmm1,%xmm2 .byte 0xf3,0xc3 .size aesni_set_encrypt_key,.-aesni_set_encrypt_key diff --git a/secure/lib/libcrypto/amd64/ghash-x86_64.S b/secure/lib/libcrypto/amd64/ghash-x86_64.S index ef024bf..950a4bb 100644 --- a/secure/lib/libcrypto/amd64/ghash-x86_64.S +++ b/secure/lib/libcrypto/amd64/ghash-x86_64.S @@ -662,10 +662,10 @@ gcm_ghash_4bit: gcm_init_clmul: .L_init_clmul: movdqu (%rsi),%xmm2 - pshufd $0b01001110,%xmm2,%xmm2 + pshufd $78,%xmm2,%xmm2 - pshufd $0b11111111,%xmm2,%xmm4 + pshufd $255,%xmm2,%xmm4 movdqa %xmm2,%xmm3 psllq $1,%xmm2 pxor %xmm5,%xmm5 @@ -679,11 +679,11 @@ gcm_init_clmul: pxor %xmm5,%xmm2 - pshufd $0b01001110,%xmm2,%xmm6 + pshufd $78,%xmm2,%xmm6 movdqa %xmm2,%xmm0 pxor %xmm2,%xmm6 movdqa %xmm0,%xmm1 - pshufd $0b01001110,%xmm0,%xmm3 + pshufd $78,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -719,8 +719,8 @@ gcm_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $0b01001110,%xmm2,%xmm3 - pshufd $0b01001110,%xmm0,%xmm4 + pshufd $78,%xmm2,%xmm3 + pshufd $78,%xmm0,%xmm4 pxor %xmm2,%xmm3 movdqu %xmm2,0(%rdi) pxor %xmm0,%xmm4 @@ -728,7 +728,7 @@ gcm_init_clmul: .byte 102,15,58,15,227,8 movdqu %xmm4,32(%rdi) movdqa %xmm0,%xmm1 - pshufd $0b01001110,%xmm0,%xmm3 + pshufd $78,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -766,7 +766,7 @@ gcm_init_clmul: pxor %xmm1,%xmm0 movdqa %xmm0,%xmm5 movdqa %xmm0,%xmm1 - pshufd $0b01001110,%xmm0,%xmm3 + pshufd $78,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -802,8 +802,8 @@ gcm_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $0b01001110,%xmm5,%xmm3 - pshufd $0b01001110,%xmm0,%xmm4 + pshufd $78,%xmm5,%xmm3 + pshufd $78,%xmm0,%xmm4 pxor %xmm5,%xmm3 movdqu %xmm5,48(%rdi) pxor %xmm0,%xmm4 @@ -823,7 +823,7 @@ gcm_gmult_clmul: movdqu 32(%rsi),%xmm4 .byte 102,15,56,0,197 movdqa %xmm0,%xmm1 - pshufd $0b01001110,%xmm0,%xmm3 + pshufd $78,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -900,14 +900,14 @@ gcm_ghash_clmul: .byte 102,65,15,56,0,218 .byte 102,69,15,56,0,218 movdqa %xmm3,%xmm5 - pshufd $0b01001110,%xmm3,%xmm4 + pshufd $78,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 .byte 102,15,58,68,231,0 movdqa %xmm11,%xmm13 - pshufd $0b01001110,%xmm11,%xmm12 + pshufd $78,%xmm11,%xmm12 pxor %xmm11,%xmm12 .byte 102,68,15,58,68,222,0 .byte 102,68,15,58,68,238,17 @@ -922,12 +922,12 @@ gcm_ghash_clmul: .byte 102,69,15,56,0,218 .byte 102,69,15,56,0,194 movdqa %xmm11,%xmm13 - pshufd $0b01001110,%xmm11,%xmm12 + pshufd $78,%xmm11,%xmm12 pxor %xmm8,%xmm0 pxor %xmm11,%xmm12 .byte 102,69,15,58,68,222,0 movdqa %xmm0,%xmm1 - pshufd $0b01001110,%xmm0,%xmm8 + pshufd $78,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,69,15,58,68,238,17 .byte 102,68,15,58,68,231,0 @@ -950,14 +950,14 @@ gcm_ghash_clmul: movdqu 32(%rdx),%xmm3 movdqa %xmm11,%xmm13 .byte 102,68,15,58,68,199,16 - pshufd $0b01001110,%xmm11,%xmm12 + pshufd $78,%xmm11,%xmm12 xorps %xmm5,%xmm1 pxor %xmm11,%xmm12 .byte 102,65,15,56,0,218 movups 32(%rsi),%xmm7 xorps %xmm4,%xmm8 .byte 102,68,15,58,68,218,0 - pshufd $0b01001110,%xmm3,%xmm4 + pshufd $78,%xmm3,%xmm4 pxor %xmm0,%xmm8 movdqa %xmm3,%xmm5 @@ -1001,7 +1001,7 @@ gcm_ghash_clmul: movdqa %xmm11,%xmm13 pxor %xmm12,%xmm4 - pshufd $0b01001110,%xmm11,%xmm12 + pshufd $78,%xmm11,%xmm12 pxor %xmm9,%xmm0 pxor %xmm8,%xmm1 pxor %xmm11,%xmm12 @@ -1011,7 +1011,7 @@ gcm_ghash_clmul: movdqa %xmm0,%xmm1 .byte 102,69,15,58,68,238,17 xorps %xmm11,%xmm3 - pshufd $0b01001110,%xmm0,%xmm8 + pshufd $78,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,68,15,58,68,231,0 @@ -1080,7 +1080,7 @@ gcm_ghash_clmul: pxor %xmm8,%xmm0 movdqa %xmm3,%xmm5 - pshufd $0b01001110,%xmm3,%xmm4 + pshufd $78,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 @@ -1097,7 +1097,7 @@ gcm_ghash_clmul: .Lmod_loop: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $0b01001110,%xmm0,%xmm4 + pshufd $78,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1135,7 +1135,7 @@ gcm_ghash_clmul: pslldq $8,%xmm0 psrldq $8,%xmm8 pxor %xmm9,%xmm0 - pshufd $0b01001110,%xmm5,%xmm4 + pshufd $78,%xmm5,%xmm4 pxor %xmm8,%xmm1 pxor %xmm5,%xmm4 @@ -1157,7 +1157,7 @@ gcm_ghash_clmul: .Leven_tail: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $0b01001110,%xmm0,%xmm4 + pshufd $78,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1205,7 +1205,7 @@ gcm_ghash_clmul: .byte 102,69,15,56,0,194 pxor %xmm8,%xmm0 movdqa %xmm0,%xmm1 - pshufd $0b01001110,%xmm0,%xmm3 + pshufd $78,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 diff --git a/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S b/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S index 6a79761..3a1e31c 100644 --- a/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S +++ b/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S @@ -2600,10 +2600,10 @@ _shaext_shortcut: punpcklqdq %xmm5,%xmm0 punpckhqdq %xmm5,%xmm8 - pshufd $0b00111111,%xmm7,%xmm1 - pshufd $0b01111111,%xmm7,%xmm9 - pshufd $0b00011011,%xmm0,%xmm0 - pshufd $0b00011011,%xmm8,%xmm8 + pshufd $63,%xmm7,%xmm1 + pshufd $127,%xmm7,%xmm9 + pshufd $27,%xmm0,%xmm0 + pshufd $27,%xmm8,%xmm8 jmp .Loop_shaext .align 32 @@ -2889,8 +2889,8 @@ _shaext_shortcut: movl 280(%rsp),%edx - pshufd $0b00011011,%xmm0,%xmm0 - pshufd $0b00011011,%xmm8,%xmm8 + pshufd $27,%xmm0,%xmm0 + pshufd $27,%xmm8,%xmm8 movdqa %xmm0,%xmm6 punpckldq %xmm8,%xmm0 diff --git a/secure/lib/libcrypto/amd64/sha1-x86_64.S b/secure/lib/libcrypto/amd64/sha1-x86_64.S index 74c9432..25c27e5 100644 --- a/secure/lib/libcrypto/amd64/sha1-x86_64.S +++ b/secure/lib/libcrypto/amd64/sha1-x86_64.S @@ -1241,9 +1241,9 @@ _shaext_shortcut: movdqa K_XX_XX+160(%rip),%xmm3 movdqu (%rsi),%xmm4 - pshufd $0b00011011,%xmm0,%xmm0 + pshufd $27,%xmm0,%xmm0 movdqu 16(%rsi),%xmm5 - pshufd $0b00011011,%xmm1,%xmm1 + pshufd $27,%xmm1,%xmm1 movdqu 32(%rsi),%xmm6 .byte 102,15,56,0,227 movdqu 48(%rsi),%xmm7 @@ -1393,8 +1393,8 @@ _shaext_shortcut: jnz .Loop_shaext - pshufd $0b00011011,%xmm0,%xmm0 - pshufd $0b00011011,%xmm1,%xmm1 + pshufd $27,%xmm0,%xmm0 + pshufd $27,%xmm1,%xmm1 movdqu %xmm0,(%rdi) movd %xmm1,16(%rdi) .byte 0xf3,0xc3 diff --git a/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S b/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S index b14c796..b9cdd9e 100644 --- a/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S +++ b/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S @@ -2678,10 +2678,10 @@ _shaext_shortcut: punpckhqdq %xmm8,%xmm14 punpckhqdq %xmm10,%xmm15 - pshufd $0b00011011,%xmm12,%xmm12 - pshufd $0b00011011,%xmm13,%xmm13 - pshufd $0b00011011,%xmm14,%xmm14 - pshufd $0b00011011,%xmm15,%xmm15 + pshufd $27,%xmm12,%xmm12 + pshufd $27,%xmm13,%xmm13 + pshufd $27,%xmm14,%xmm14 + pshufd $27,%xmm15,%xmm15 jmp .Loop_shaext .align 32 @@ -3067,10 +3067,10 @@ _shaext_shortcut: movl 280(%rsp),%edx - pshufd $0b00011011,%xmm12,%xmm12 - pshufd $0b00011011,%xmm13,%xmm13 - pshufd $0b00011011,%xmm14,%xmm14 - pshufd $0b00011011,%xmm15,%xmm15 + pshufd $27,%xmm12,%xmm12 + pshufd $27,%xmm13,%xmm13 + pshufd $27,%xmm14,%xmm14 + pshufd $27,%xmm15,%xmm15 movdqa %xmm12,%xmm5 movdqa %xmm13,%xmm6 diff --git a/secure/lib/libcrypto/amd64/x86_64-mont.S b/secure/lib/libcrypto/amd64/x86_64-mont.S index 3e67383..d3c1c71 100644 --- a/secure/lib/libcrypto/amd64/x86_64-mont.S +++ b/secure/lib/libcrypto/amd64/x86_64-mont.S @@ -35,6 +35,20 @@ bn_mul_mont: movq %r11,8(%rsp,%r9,8) .Lmul_body: + + + + + + + subq %rsp,%r11 + andq $-4096,%r11 +.Lmul_page_walk: + movq (%rsp,%r11,1),%r10 + subq $4096,%r11 +.byte 0x66,0x2e + jnc .Lmul_page_walk + movq %rdx,%r12 movq (%r8),%r8 movq (%r12),%rbx @@ -232,6 +246,14 @@ bn_mul4x_mont: movq %r11,8(%rsp,%r9,8) .Lmul4x_body: + subq %rsp,%r11 + andq $-4096,%r11 +.Lmul4x_page_walk: + movq (%rsp,%r11,1),%r10 + subq $4096,%r11 +.byte 0x2e + jnc .Lmul4x_page_walk + movq %rdi,16(%rsp,%r9,8) movq %rdx,%r12 movq (%r8),%r8 @@ -654,6 +676,15 @@ bn_sqr8x_mont: subq %r11,%rsp .Lsqr8x_sp_done: andq $-64,%rsp + movq %rax,%r11 + subq %rsp,%r11 + andq $-4096,%r11 +.Lsqr8x_page_walk: + movq (%rsp,%r11,1),%r10 + subq $4096,%r11 +.byte 0x2e + jnc .Lsqr8x_page_walk + movq %r9,%r10 negq %r9 diff --git a/secure/lib/libcrypto/amd64/x86_64-mont5.S b/secure/lib/libcrypto/amd64/x86_64-mont5.S index cff6c72..b47c677 100644 --- a/secure/lib/libcrypto/amd64/x86_64-mont5.S +++ b/secure/lib/libcrypto/amd64/x86_64-mont5.S @@ -31,6 +31,20 @@ bn_mul_mont_gather5: movq %rax,8(%rsp,%r9,8) .Lmul_body: + + + + + + + subq %rsp,%rax + andq $-4096,%rax +.Lmul_page_walk: + movq (%rsp,%rax,1),%r11 + subq $4096,%rax +.byte 0x2e + jnc .Lmul_page_walk + leaq 128(%rdx),%r12 movdqa 0(%r10),%xmm0 movdqa 16(%r10),%xmm1 @@ -443,6 +457,15 @@ bn_mul4x_mont_gather5: subq %r11,%rsp .Lmul4xsp_done: andq $-64,%rsp + movq %rax,%r11 + subq %rsp,%r11 + andq $-4096,%r11 +.Lmul4x_page_walk: + movq (%rsp,%r11,1),%r10 + subq $4096,%r11 +.byte 0x2e + jnc .Lmul4x_page_walk + negq %r9 movq %rax,40(%rsp) @@ -1032,6 +1055,15 @@ bn_power5: subq %r11,%rsp .Lpwr_sp_done: andq $-64,%rsp + movq %rax,%r11 + subq %rsp,%r11 + andq $-4096,%r11 +.Lpwr_page_walk: + movq (%rsp,%r11,1),%r10 + subq $4096,%r11 +.byte 0x2e + jnc .Lpwr_page_walk + movq %r9,%r10 negq %r9 @@ -1973,6 +2005,15 @@ bn_from_mont8x: subq %r11,%rsp .Lfrom_sp_done: andq $-64,%rsp + movq %rax,%r11 + subq %rsp,%r11 + andq $-4096,%r11 +.Lfrom_page_walk: + movq (%rsp,%r11,1),%r10 + subq $4096,%r11 +.byte 0x2e + jnc .Lfrom_page_walk + movq %r9,%r10 negq %r9 |