aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikio Hara <mikioh.mikioh@gmail.com>2017-01-06 08:27:37 +0900
committerBrad Fitzpatrick <bradfitz@golang.org>2017-01-07 00:38:37 +0000
commit66063b2da8a93b69e23381260f64c05d1589769c (patch)
treecba0c39e3a782dfa7aefea3fbe6e191741006dd8
parent5ddfa69fef1be072c07a5f25b71c9d5158055ca9 (diff)
downloadgo-66063b2da8a93b69e23381260f64c05d1589769c.tar.gz
go-66063b2da8a93b69e23381260f64c05d1589769c.zip
vendor: update golang.org/x/crypto/chacha20poly1305
Updates golang.org/x/crypto/chacha20poly1305 to rev cb497ae for: - chacha20poly1305: fix detection of BMI on amd64 (https://golang.org/cl/34852) - chacha20poly1305: fix typos (https://golang.org/cl/34536) - chacha20poly1305: fix typos (https://golang.org/cl/33855) - chacha20poly1305: fix build constraints (https://golang.org/cl/32391) Change-Id: I3a608b5e21b3a72b5aaa5d0afe6c6cffbb1d6fc1 Reviewed-on: https://go-review.googlesource.com/34871 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-rw-r--r--src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go2
-rw-r--r--src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s26
-rw-r--r--src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go2
3 files changed, 20 insertions, 10 deletions
diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go b/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go
index f0d34856b2..4755033212 100644
--- a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go
+++ b/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build amd64,go1.7
+// +build go1.7,amd64,!gccgo,!appengine
package chacha20poly1305
diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s b/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s
index 7c6a1a5e68..39c58b44a3 100644
--- a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s
+++ b/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s
@@ -4,7 +4,7 @@
// This file was originally from https://golang.org/cl/24717 by Vlad Krasnov of CloudFlare.
-// +build go1.7
+// +build go1.7,amd64,!gccgo,!appengine
#include "textflag.h"
// General register allocation
@@ -280,9 +280,14 @@ TEXT ·chacha20Poly1305Open(SB), 0, $288-97
// Check for AVX2 support
CMPB runtime·support_avx2(SB), $0
JE noavx2bmi2Open
- CMPB runtime·support_bmi2(SB), $1 // for MULXQ
- JE chacha20Poly1305Open_AVX2
+
+ // Check BMI2 bit for MULXQ.
+ // runtime·cpuid_ebx7 is always available here
+ // because it passed avx2 check
+ TESTL $(1<<8), runtime·cpuid_ebx7(SB)
+ JNE chacha20Poly1305Open_AVX2
noavx2bmi2Open:
+
// Special optimization, for very short buffers
CMPQ inl, $128
JBE openSSE128 // About 16% faster
@@ -1489,9 +1494,14 @@ TEXT ·chacha20Poly1305Seal(SB), 0, $288-96
// Check for AVX2 support
CMPB runtime·support_avx2(SB), $0
JE noavx2bmi2Seal
- CMPB runtime·support_bmi2(SB), $1 // for MULXQ
- JE chacha20Poly1305Seal_AVX2
+
+ // Check BMI2 bit for MULXQ.
+ // runtime·cpuid_ebx7 is always available here
+ // because it passed avx2 check
+ TESTL $(1<<8), runtime·cpuid_ebx7(SB)
+ JNE chacha20Poly1305Seal_AVX2
noavx2bmi2Seal:
+
// Special optimization, for very short buffers
CMPQ inl, $128
JBE sealSSE128 // About 15% faster
@@ -1695,7 +1705,7 @@ sealSSETail64:
MOVO D1, ctr0Store
sealSSETail64LoopA:
- // Perform ChaCha rounds, while hashing the prevsiosly encrpyted ciphertext
+ // Perform ChaCha rounds, while hashing the previously encrypted ciphertext
polyAdd(0(oup))
polyMul
LEAQ 16(oup), oup
@@ -1729,7 +1739,7 @@ sealSSETail128:
MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store
sealSSETail128LoopA:
- // Perform ChaCha rounds, while hashing the prevsiosly encrpyted ciphertext
+ // Perform ChaCha rounds, while hashing the previously encrypted ciphertext
polyAdd(0(oup))
polyMul
LEAQ 16(oup), oup
@@ -1775,7 +1785,7 @@ sealSSETail192:
MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2; MOVO D2, ctr2Store
sealSSETail192LoopA:
- // Perform ChaCha rounds, while hashing the prevsiosly encrpyted ciphertext
+ // Perform ChaCha rounds, while hashing the previously encrypted ciphertext
polyAdd(0(oup))
polyMul
LEAQ 16(oup), oup
diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go b/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go
index 1d4dcd33fd..4c2eb703c3 100644
--- a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go
+++ b/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !amd64 !go1.7
+// +build !amd64 !go1.7 gccgo appengine
package chacha20poly1305